函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\amd_gart_64.c Create Date:2022-07-27 09:51:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Map a single continuous physical area into the IOMMU.* Caller needs to check if the iommu is needed and flush.

函数原型:static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem, size_t size, int dir, unsigned long align_mask)

返回类型:dma_addr_t

参数:

类型参数名称
struct device *dev
dma_addr_tphys_mem
size_tsize
intdir
unsigned longalign_mask
203  npages等于iommu_num_pages(phys_mem, size, PAGE_SIZE)
207  如果此条件成立可能性小(为编译器优化)(phys_mem + size > GART can only remap to physical addresses < 1TB )则返回:DMA_MAPPING_ERROR
210  iommu_page等于alloc_iommu(dev, npages, align_mask)
211  如果iommu_page恒等于负1则
212  如果非nonforced_iommu(dev, phys_mem, size)则返回:phys_mem
214  如果panic_on_overflowpanic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns.
216  iommu_full(dev, size, dir)
217  返回:DMA_MAPPING_ERROR
220 i小于npages循环
221  Remapping table [iommu_page + i]等于GPTE_ENCODE(phys_mem)
222  phys_mem加等于PAGE_SIZE
224  返回:GART remapping area (physical) iommu_pagePAGE_SIZEphys_mem按位与PAGE_MASK的反的值
调用者
名称描述
gart_map_pageMap a single area into the IOMMU
dma_map_sg_nonforceFallback for dma_map_sg in case of overflow
gart_alloc_coherentallocate and map a coherent mapping