I am trying to understand how mmap works. The user level call mmap is as follows.
void *mmap(void *addr, size_t len, int prot, int flags,
int fildes, off_t off);
but the mmap level for a specific device driver is as follows:
int <device_name>_mmap(struct file*fp, struct vm_area_struct *vma)
I also looked at the source code, but I can not find the connection between them.
How does mmap for a particular device get its arguments "struct vm_area_struct * vma"? Could you help me figure this out? Appreciate your help.
source
share