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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章