LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-26-2009, 10:00 AM   #1
akshaynm87
LQ Newbie
 
Registered: Apr 2009
Location: Bengaluru
Distribution: Ubuntu 8.10
Posts: 10

Rep: Reputation: 0
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?
 
Old 06-26-2009, 07:04 PM   #2
ranthal
LQ Newbie
 
Registered: Jun 2009
Location: Carlsbad, CA
Posts: 24

Rep: Reputation: 15
Quote:
Originally Posted by akshaynm87 View Post
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?
 
Old 06-29-2009, 09:39 AM   #3
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 492

Rep: Reputation: 50
You need to implement the "mmap" fops
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing User mode buffer in Kernel module akshaynm87 Linux - Newbie 0 05-15-2009 05:36 AM
Real time and user-space code raedbenz Linux - Embedded & Single-board computer 0 07-15-2008 03:38 AM
Accessing a kernel buffer from user space jan_capri Linux - Kernel 2 05-21-2007 11:44 PM
accessing data structure of eth0 from user space???? raklo Linux - Kernel 10 02-09-2007 04:12 AM
Can I access NIC directly from user space? jollyshah Linux - Networking 2 01-04-2007 01:32 PM


All times are GMT -5. The time now is 03:45 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration