linux驱动中分配连续物理内存

来源:互联网 发布:js怎么改变css样式 编辑:程序博客网 时间:2024/04/30 07:41
移植exynos4412的MFC驱动时,出现了
dma_alloc_coherent失败,于是展开其了解作用,如下:
dma_alloc_coherent & dma_alloc_writecombine都是分配连续物理内存,返回虚拟地址dma_alloc_coherent#define pgprot_noncached(prot) __pgprot(pgprot_val(prot) & ~(L_PTE_CACHEABLE | L_PTE_BUFFERABLE))禁用cahceable 和 bufferabledma_alloc_writecombine#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE)禁用cahceable 

谈到
dma_alloc_coherent ,就不得不提
cma,和ump
cma & umpcma: 管理连续内存,可以预留好,可以用到时分配。4412BSP中为预留。ump:mali使用内存,使用时动态配分(alloc_page)
0 0