Messages in this thread | | | Subject | Bug (?) when implementing a vm_ops->nopage() method | Date | Mon, 07 Jun 1999 13:30:03 EDT | From | Brett W Vasconcellos <> |
| |
In Linux version 2.2.5-15, when I implement the vm_ops->nopage() method in order to allow my device driver to do an mmap() to share a large buffer between the driver and user space, I found that returning a physical page address does not work.
As I understand from reading Rubini's Linux Device Drivers and from talking to various kernel hackers, the intended sematics of nopage() is that it should return the physical page address that it wants the user's virtual page to get mapped to.
Instead, nopage() must return a virtual address (for example, by returning "phys_to_virt(page)" instead of "page") for things to work correctly.
It looks to me like do_no_page() in mm/memory.c uses mk_pte() when it should be using mk_pte_phys()?
By the way, is there any documentation for the sematics of functions like nopage() and other interfaces for people trying to write drivers and such, or is the only way to learn this stuff by looking at other people's code as well as the code I'm interfacing with (like do_no_page). It seems like the Linux kernel could really use an interface description for all the functions kernel programmers call or implement in their device drivers and whatnot...
Thanks, Brett
PS If anyone knows of existing (working) driver code that uses vm_ops->nopage() to implement mmap() I would appreciate a pointer to it!
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |