On Tue, 21 Sep 1999, Dresner, Norman A. wrote:

> I'm writing a program which will use Shared Memory (above the
> append="mem=XXm" level) for (two-way) communication of large real-time
> messages between a module/device-driver and a user-space program. 
> 
> Because I like to keep things neat and readable (I do know I won't live
> forever),  a "formal" malloc-like mechanism for Shared Memory would make the
> program more self-documenting, certainly more so than with just a bunch of
> #defines and the like.

You can use the following code (kernel space):

#define SIZE=1024*1024*4;
char * buffer;

if(shm_allocate("example_name",SIZE, &buffer) != SIZE)
        return -ENOMEM;


then you can use:

shm_deallocate(buffer);

For use in user space see: tester.c in
http://crds.chemie.unibas.ch/PCI-MIO-E/mbuff-0.6pre5-rtl.tar.gz

To get a separate module (not in rtl_nfifo.o) change options at the
beginning of Makefile. Or use mbuff-0.6pre4 and remove  rtl_nfifo.o from the
Makefile.

--
Tomek

--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/

Reply via email to