lkml.org 
[lkml]   [2010]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question: how to copy to user space from a tasklet
Tom Brown wrote:
> Thanks, think I'm there:
>
> 1 - The user calls mmap() with a specific offset to flag that he wants a
> DMA buffer
>
> 2 - I then 'vmalloc' the buffer, and call 'setPageReserved' for each page
>
> I then step over each page, and:
>
> 3 - call 'vmalloc_to_pfn' to get a PFN for each page, and then
>
> 4 - call 'remap_page_range' for that page (I instead call
> 'remap_pfn_range' for kernels >= 2.6.10, but I'm on 2.6.9)
>
> This gives me the buffer, and the interrupt handler then just uses
> 'memcpy' to copy data to the user.

I would have thought of a bunch of alloc_page() and vm_insert_page() but I
don't know if vm_insert_page exists in 2.6.9 and if it honors user limits.

Plus dma_map_page() to get zero-copy operation with a DMA capable device.
--
Stefan Richter
-=====-==-=- =-=- =--=-
http://arcgraph.de/sr/

\
 
 \ /
  Last update: 2010-10-18 19:09    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site