Messages in this thread | | | From | Jim Zelenka <> | Subject | mapping user memory to kernel space (another porting question) | Date | Tue, 27 Apr 1999 14:26:31 -0400 |
| |
Background: I'm porting a somewhat complex embedded system to the linux kernel. I'm trying to do this as a set of kernel modules to avoid requiring modifications to the linux kernel.
Right now I'm running into the following problem: given an arbitrary buffer in a user's address space, I must wire it down to prevent paging and access it from the kernel. I can accomplish the former with mlock(), but I am having trouble figuring out how to accomplish the latter. It seems that I should call get_vm_area() to allocate a range in the kernel's address space, then some incantation involving alloc_area_pmd() and/or alloc_area_pte() along with set_pgdir() to insert the correct mappings, which I extract with pmd_offset() and pte_offset(). Unfortunately, get_vm_area() is not exported to modules, and I cannot find any other set of interfaces which seem like they would do what I want. I've tried reading various bits of documentation, but everything I've found assumes that I have a contiguous set of physical pages to remap, and so ioremap() will do what I want. Since the user's buffer may span an arbitrary set of non-physically-contiguous pages, that solution doesn't work for me.
As before, any thoughts, suggestions, pointers, etc would be greatly appreciated.
Thanks,
-Jim.Zelenka@cs.cmu.edu Senior Research Programmer CMU/SCS Parallel Data Lab http://www.pdl.cs.cmu.edu/PEOPLE/jimz.html
- 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/
| |