LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   Accessing User Space Buffer directly in Kernel code (https://www.linuxquestions.org/questions/linux-kernel-70/accessing-user-space-buffer-directly-in-kernel-code-735833/)

akshaynm87 06-26-2009 10:00 AM

Accessing User Space Buffer directly in Kernel code
 
Hi
I am writing a device driver that provides an ioctl interface and read and write operations on its device node. I have a user mode application which talks to the driver through read, write or ioctl interface.
I would need to pass huge amounts of data from the application to the driver and vice versa. Hence, using copy_to_user() and copy_from_user() in the driver is not an exciting option for me since it slows down the execution as well as occupies more memory.
Is there any way i can use the buffer allocated by the application to read/ write data from/to without copying?

ranthal 06-26-2009 07:04 PM

Quote:

Originally Posted by akshaynm87 (Post 3587171)
Hi
Hence, using copy_to_user() and copy_from_user() in the driver is not an exciting option for me since it slows down the execution as well as occupies more memory.

Are these related to get_user and put_user from asm/uaccess.h?

jf.argentino 06-29-2009 09:39 AM

You need to implement the "mmap" fops


All times are GMT -5. The time now is 05:02 AM.