First page Back Continue Last page Overview Graphics
How to implement mmap - Kernel space
Character driver: implement a mmap file operation
and add it to the driver file operations:
int (*mmap) (
struct file *, /* Open file structure */
struct vm_area_struct * /* Kernel VMA structure */
Initialize the mapping.
Can be done in most cases with the remap_pfn_range() function, which takes care of most of the job.