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

移植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 和 bufferable

dma_alloc_writecombine
#define pgprot_writecombine(prot) __pgprot(pgprot_val(prot) & ~L_PTE_CACHEABLE)
禁用cahceable 

谈到
dma_alloc_coherent ,就不得不提
cma,和ump
cma & ump


cma: 管理连续内存,可以预留好,可以用到时分配。4412BSP中为预留。

ump:mali使用内存,使用时动态配分(alloc_page)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章