我dma_alloc_coherent()在我的自定义驱动程序中使用来获取虚拟地址和总线地址。
res->KernelAddress = (u64)dma_alloc_coherent( &DevExt->pdev->dev, size, &res->BusAddress, GFP_ATOMIC );
当打印 (%llx) 总线地址 (res->BusAddress) 时,我得到了 80009000 作为一个。我检查了 /proc/iomem 的日志以验证范围,但有多个条目。
/proc/iomem 的日志如下所示:
10000000-10000fff : /pcie-controller@10003000/pci@1,0
10003000-100037ff : pcie-pads
10003800-10003fff : pcie-afi
10004000-10004fff : /pcie-controller@10003000/pci@3,0
40000000-4fffffff : pcie-config-space
50100000-57ffffff : pcie-non-prefetchable
50800000-52ffffff : PCI Bus 0000:01
50800000-5087ffff : 0000:01:00.0
51000000-51ffffff : 0000:01:00.0
52000000-52ffffff : 0000:01:00.0
58000000-7fffffff : pcie-prefetchable
58000000-58ffffff : PCI Bus 0000:01
58000000-58ffffff : 0000:01:00.0
80000000-d82fffff : System RAM
80080000-810fafff : Kernel code
8123f000-814b3fff : Kernel data
d9300000-efffffff : System RAM
f0200000-275ffffff : System RAM
276600000-2767fffff : System RAM
- 80009000有效吗?它属于哪个部分?
- 是否有必要使用
dma_mmap_coherent()afterdma_alloc_coherent()进行正确的映射?
提前致谢 !!