¡¡¡¡È»¶ø£¬vmalloc_to_pageû·¨ÓÃÔÚioremapËùµÃµ½µÄµØÖ·ÉÏ£¬ÒòΪIO¿Õ¼ä¸ù±¾¾ÍûÓжÔÓ¦µÄPage½á¹¹£¬·µ»ØµÄpageÖ¸Õë×ÔÈ»ÊDz»¶ÔµÄ¡£
¡¡¡¡ÕýÈ·µÄ×ö·¨ÊÇÔÚmmapº¯ÊýÀʹÓÃremap_pfn_rangeº¯Êý¡£´úÂëÈçÏ¡£×¢ÒâÒªÉèÖÃÒ»ÏÂvma->vm_pgoffΪÄãÒªmapµÄio¿Õ¼äµÄÎïÀíµØÖ·¶ÔÓ¦µÄÒ³¡£
ÒýÓÃ:static int filter_mmap(struct file *filp, struct vm_area_struct *vma)
{
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
vma->vm_pgoff = ( (u32)map_start >> PAGE_SHIFT);
if (remap_pfn_range(vma,
vma->vm_start,
vma->vm_pgoff,
vma->vm_end-vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;
return 0;
}