他先check device有沒有implement mmap,如果有就執行device的mmap,
如果沒有就執行fbmem default的mmap:
start = fix.smem_start; // fd的fix data: fb的start address
off += start;
vma->pgoff = off >> PAGE_SHIFT;
...
io_remap_page_range(vma_start,off,
vma->vm_end - vma->vm_start, vma->vm_page_prot);
其中io_remap_page_range( )在asm-arm/io.h中define為
remap_page_range(from, physic,size,prot)
所以實off就是physical address,這個address在mmap return時會藉由vma->vm_pgoff
轉成return value傳給caller application
沒有留言:
張貼留言