- allows userspace direct access to device memory
- benefits:
- avoids buffering: can improve performace
- direct access to registers can avoid many
ioctl
- only makes sense in certain circumstances: e.g. not for stream
oriented devices
API: mmap
file operation
int *mmap (struct file *filp, struct vm_area_struct *vma);
build page tables
int remap_pfn_range(struct vm_area_struct *vma, unsigned long virt_addr,
unsigned long pfn, unsigned long size, pgprot_t prot);
/* identical to above on most plattforms: */
int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long virt_addr,
unsigned long phys_addr, unsigned long size, pgprot_t prot);