Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\coherent.c Create Date:2022-07-28 10:33:55
Last Modify:2020-03-17 14:54:14 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__dma_mmap_from_coherent

Proto:static int __dma_mmap_from_coherent(struct dma_coherent_mem *mem, struct vm_area_struct *vma, void *vaddr, size_t size, int *ret)

Type:int

Parameter:

TypeParameterName
struct dma_coherent_mem *mem
struct vm_area_struct *vma
void *vaddr
size_tsize
int *ret
240  If mem && vaddr >= virt_base && vaddr + size <= virt_base + (size << PAGE_SHIFT determines the page size ) Then
242  off = Offset (within vm_file) in PAGE_SIZEunits
243  start = vaddr - virt_base >> PAGE_SHIFT determines the page size
244  user_count = vma_pages(vma)
245  count = align the pointer to the (next) page boundary (size) >> PAGE_SHIFT determines the page size
247  ret = -ENXIO
248  If off < count && user_count <= count - off Then
249  pfn = pfn_base + start + off
254  Return 1
256  Return 0
Caller
NameDescribe
dma_mmap_from_dev_coherentdma_mmap_from_dev_coherent() - mmap memory from the device coherent pool*@dev: device from which the memory was allocated*@vma: vm_area for the userspace memory*@vaddr: cpu address returned by dma_alloc_from_dev_coherent*@size: size of the memory buffer
dma_mmap_from_global_coherent