Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\direct.c Create Date:2022-07-28 10:33:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:dma_direct_mmap

Proto:int dma_direct_mmap(struct device *dev, struct vm_area_struct *vma, void *cpu_addr, dma_addr_t dma_addr, size_t size, unsigned long attrs)

Type:int

Parameter:

TypeParameterName
struct device *dev
struct vm_area_struct *vma
void *cpu_addr
dma_addr_tdma_addr
size_tsize
unsigned longattrs
446  user_count = vma_pages(vma)
447  count = align the pointer to the (next) page boundary (size) >> PAGE_SHIFT determines the page size
448  pfn = PHYS_PFN(dma_to_phys(dev, dma_addr))
449  ret = -ENXIO
451  Access permissions of this VMA. = Return the page attributes used for mapping dma_alloc_* memory, either in* kernel space if remapping is needed, or to userspace through dma_mmap_*.
453  If dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, & ret) Then Return ret
456  If Offset (within vm_file) in PAGE_SIZEunits >= count || user_count > count - Offset (within vm_file) in PAGE_SIZEunits Then Return -ENXIO
458  Return remap_pfn_range(vma, Our start address within vm_mm. , pfn + Offset (within vm_file) in PAGE_SIZEunits , user_count << PAGE_SHIFT determines the page size , Access permissions of this VMA. )
Caller
NameDescribe
dma_mmap_attrsdma_mmap_attrs - map a coherent DMA allocation into user space*@dev: valid struct device pointer, or NULL for ISA and EISA-like devices*@vma: vm_area_struct describing requested user mapping*@cpu_addr: kernel CPU-view address returned from