void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, int flag);
This function handles both distribution and display of the buffer. The first two arguments are the structure of the device and the size of the required buffer. The function returns the result of the DMA mapping in two places. The return value of the function is the virtual kernel address for the buffer that can be used by the driver. The corresponding bus address, meanwhile, is returned in dma_handle.
source share