Re: DMA to/from user buffers

Helge Hafting (helgehaf@idb.hist.no)
Wed, 05 Sep 2001 09:51:22 +0200


Sebastian Heidl wrote:
>
> Hi,
>
> two questions about using an user-supplied buffer (e.g. malloced
> in user space) for DMA transfers:
>
> 1. Is it possible ?
> 2. What restrictions/requirements apply for the buffer (alignment...) ?

There are some obvious problems with this. First, a malloc'ed
buffer might not be in memory. It might not be created yet if you
haven't touched it, and it might be on swap if you have.

The recommended way is to allocate in the kernel, (probably by
the driver that want to do DMA), and mmap this buffer into
userspace.

Helge Hafting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/