dma_alloc_coherent ->__dma_alloc->

* These are the page tables (2MB each) covering uncached, DMA consistent allocations
分析consistent_init(void)-》(consistent.c):

pgd = pgd_offset(&init_mm, base);

struct mm_struct init_mm = INIT_MM(init_mm);每个进程一个mm_struct结构

就是对2m的空间申请页面,把页面表项放入consistent_pte中去

更加准确的说dma_alloc_coherent 不是要在用到dma的时候才用它来分配空间的,而是在用到总线地址的时候用它来分配空间,例如:mx27的pp就用到总线地址,所以用dma_alloc_coherent 来分配空间,,

更多推荐

dma_alloc_coherent 分析