免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12345678
最近访问板块 发新帖
楼主: epegasus
打印 上一主题 下一主题

还是不理解IOMMU、北桥、PCI的MMIO和ioremap [复制链接]

论坛徽章:
9
程序设计版块每日发帖之星
日期:2016-02-13 06:20:00数据库技术版块每日发帖之星
日期:2016-06-15 06:20:00数据库技术版块每日发帖之星
日期:2016-06-16 06:20:00数据库技术版块每日发帖之星
日期:2016-06-18 06:20:00程序设计版块每日发帖之星
日期:2016-06-27 06:20:00程序设计版块每日发帖之星
日期:2016-07-09 06:20:00IT运维版块每日发帖之星
日期:2016-07-15 06:20:00IT运维版块每日发帖之星
日期:2016-07-27 06:20:00程序设计版块每日发帖之星
日期:2016-08-18 06:20:00
71 [报告]
发表于 2013-11-02 08:32 |只看该作者
本帖最后由 mordorwww 于 2013-11-02 08:40 编辑
mordorwww 发表于 2013-11-02 08:06
只是不知道cpu虚拟地址到PCI BAR的访问映射是由谁完成的?走不走CPU的MMU?



ioremap函数是否会写页表

如果CPU读写一个没有做映射的IO地址,是否会产生内存异常,就像CPU访问一个空洞的系统内存地址一样

论坛徽章:
0
72 [报告]
发表于 2013-11-11 13:13 |只看该作者
//Here is my comments
phymem = pci_resource_start(pdev, 0);               //<--it retrieves the physical address preallocated(normally by u-boot) to this pci device "pdev"
    if (!request_mem_region(phymem, pci_resource_len(pdev, 0), "eth")) {   //<--is this physical address being used by others ?
        printk(KERN_ERR "eth_pci: cannot reserve PCI memory region\n");   //<-- if yes, then report error
        goto bad;
    }

    mem = (unsigned long) ioremap(phymem, pci_resource_len(pdev, 0));   //<--map the physical address to linx kernel virtual address  !
    if (!mem) {
        printk(KERN_ERR "eth_pci: cannot remap PCI memory region\n") ;
        goto bad1;
    }
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP