[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.028 / U:4.720 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site