wan_zilove 发表于 2010-05-05 13:26

dma_alloc_coherent返回的地址是内核虚拟地址吗?

char *src;
dma_addr_t memory_phy_base;

src = dma_alloc_coherent(NULL, 0x4000, &memory_phy_base, GFP_KERNEL|GFP_DMA);

printk("src:%08lx, virt_to_phys: %08lx, actual_phys: %08lx,phy_to_virt: %08lx",
         (unsigned long)src,
         (unsigned long)virt_to_phys(src),
         (unsigned long )memory_phy_base,
         (unsigned long)phys_to_virt(memory_phy_base));

运行结果:
src:ff8ee000, virt_to_phys: df8ee000, actual_phys: a0080000,phy_to_virt: c0080000


内核中设置的
phys_base_addr:a065a000
virt_base_addr:c065a000
页: [1]
查看完整版本: dma_alloc_coherent返回的地址是内核虚拟地址吗?