DMA buffer again

Paolo Mantegazza mantegazza at aero.polimi.it
Wed Jan 28 10:20:46 CET 2004


William Montgomery wrote:
> Hi Paolo,
> 
> You have helped me in the past, finally I can give back...
> See below.
> 
> On Tue, 27 Jan 2004, Paolo Mantegazza wrote:
> 
> 
>>Rodrigo Amestica wrote:
>>
>>>if I use rt_malloc I cannot make the buffer available to user-land, or?
>>>I did not say it before, but the buffer must be readable from user space.
>>>
>>>Looks like I cannot make a DMA contiguous buffer available to user land,
>>>it looks like I will need to copy from the DMA buffer to a place where
>>>user-land can read. I was trying to avoid this copying step.
>>>
>>
>>I tried without much success to mmap kmalloced memory. My assumption is
>>it should be possible, even if did not find a way. Does anybody has a
>>solution.
>>
> 
> You have to use the mem_map_reserve() kernel function for the pages
> you are using so that they are remappable, i.e. available for user space.
> A google search will give me details.
> 
> 
>>It has been likely gone unnoticed but the new shm.c in RTAI 3.x dev
>>threds has much more flexibility for sharing memory but it is still
>>vmalloc based. Having an option for vmalloc and kmalloc to be used
>>toghether and the capability to mmap what kmalloc could be helpfull.
>>

Thanks for the clue, I'll dig into it and I'll see what I can do to add 
further flexibility to RTAI shared memory services.

Paolo.





More information about the Rtai mailing list