kernel driver access application memory
Mandeep Sandhu
mandeepsandhu.chd at gmail.com
Thu Jan 16 10:04:25 EST 2014
On Wed, Jan 15, 2014 at 11:45 PM, m silverstri <
michael.j.silverstri at gmail.com> wrote:
> Hi,
>
> If my application allocate memory for input and output buffers, and
> pass the pointer to a kernel driver (via v4l2 queue buffer operation),
> can the kernel driver access it? Do I need to setup DMA before teh
> kernel driver can read/write to it?
>
You can transfer data to & from kernelspace/userspace by using
copy_to/from_user() API.
However, for DMA I think you might also want to lock the user pages in
memory so that they are not invalidated when the owning process is
scheduled out. This is a very high-level gist, but there a lot of resources
out there which show how this can be done.
HTH,
-mandeep
>
> Thank you.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140116/345863b6/attachment-0001.html
More information about the Kernelnewbies
mailing list