[lkml]   [2000]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: DMA to user space

On Wed, 15 Mar 2000 17:12:16 -0500, John Wilson <>

> I hope I'm asking this in the right place, flame away if not! :-)
> I'm writing a driver for a strange DMA device and I would like to be able
> to do DMA directly into the user's buffer. Is this possible?

Yes. In 2.3, look at the the raw IO code in drivers/char/raw.c. It
uses the "kiobuf" mechanism to locate the "struct page *"s associated
with an arbitrary user buffer: map_user_kiobuf() does all the hard
work. The driver can then use those pages in any way it wants.

> So, is it as simple as requiring the user to mlock() the buffer and then
> using virt_to_bus to get the page addresses? Or is it more complicated, or
> just totally hopeless?

It's a bit more complex than that, but map_user_kiobuf() takes care of
it. There's a version for 2.2 if you want it.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:57    [W:0.057 / U:4.284 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site