Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DMA_MEMORY_MAP #11

Open
JunningWu opened this issue Jun 25, 2018 · 0 comments
Open

DMA_MEMORY_MAP #11

JunningWu opened this issue Jun 25, 2018 · 0 comments

Comments

@JunningWu
Copy link
Owner

int
577		dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
578					    dma_addr_t device_addr, size_t size, int
579					    flags)
580	
581	Declare region of memory to be handed out by dma_alloc_coherent() when
582	it's asked for coherent memory for this device.
583	
584	phys_addr is the CPU physical address to which the memory is currently
585	assigned (this will be ioremapped so the CPU can access the region).
586	
587	device_addr is the DMA address the device needs to be programmed
588	with to actually address this memory (this will be handed out as the
589	dma_addr_t in dma_alloc_coherent()).
590	
591	size is the size of the area (must be multiples of PAGE_SIZE).
592	
593	flags can be ORed together and are:
594	
595	- DMA_MEMORY_EXCLUSIVE - only allocate memory from the declared regions.
596	  Do not allow dma_alloc_coherent() to fall back to system memory when
597	  it's out of memory in the declared region.
598	
599	As a simplification for the platforms, only *one* such region of
600	memory may be declared per device.
601	
602	For reasons of efficiency, most platforms choose to track the declared
603	region only at the granularity of a page.  For smaller allocations,
604	you should use the dma_pool() API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant