[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem finding kernel address for a memory buffer
I've got an application where a device driver is trying to translate a user
memory buffer address into a kernel address.
The memory is allocated with shmget() because it is a shared memory segment
shared by multiple processes. The underlying allocation is kmalloc.
Sometimes my code works, but other times the maplist returned by a call to
map_user_kiobuf() contains all zeros. When the code is working, it continues
working until after a reboot.
The user memory buffer is working properly in the process, but I can not
access it from the driver.
unsigned int *buffer_address; // address of user memory buffer
struct kiobuf *iobuf;
map_user_kiobuf(READ, iobuf, (unsigned long) buffer_address, 1);
When it fails, iobuf->maplist[0] == 0, iobuf->offset == 0, and
page_address(iobuf->maplist[0]) == 0.
Can someone tell me what else I should be doing or checking?, or if there is
more information I can provide to help fix this?
Dave Z.
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/