函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\direct.c Create Date:2022-07-27 11:33:10
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:dma_direct_mmap

函数原型: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)

返回类型:int

参数:

类型参数名称
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  如果dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, & ret)则返回:ret
456  如果Offset (within vm_file) in PAGE_SIZEunits 大于等于countuser_count大于countOffset (within vm_file) in PAGE_SIZEunits 则返回:负ENXIO
458  返回: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. )
调用者
名称描述
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