Welcome! Log In Create A New Profile


Question about DMA mapping API in Linux

Posted by colis 
Question about DMA mapping API in Linux
January 20, 2016 08:54AM
In Linux, some APIs are provided to do DMA mapping.
My question is about "dma_alloc_coherent", it is defined in "linux/dma-mapping.h".
And in the DMA-API.txt, it says:

* dma_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag)
This routine allocates a region of bytes of consistent memory.
Consistent memory can be expensive on some platforms, and the minimum allocation length may be as big as a page

So on x86 architecture, 1 page=4096 Byte.
Now if I define "size = 8192", is the 8KB allocated memory all consistent?
If so, does it mean that the 2 pages allocated are consistent?
With this API we don't need to worry about page-crossing, and all "Hard Address" sent to device are continuous addresses, am I right?

Thx for advance.

Your Email:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 3 plus 4?