函数逻辑报告

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:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:alloc_iommu

函数原型:static unsigned long alloc_iommu(struct device *dev, int size, unsigned long align_mask)

返回类型:unsigned long

参数:

类型参数名称
struct device *dev
intsize
unsigned longalign_mask
98  base_index等于@a is a power of 2 value (GART remapping area (physical) & dma_get_seg_boundary(dev), PAGE_SIZE)右移PAGE_SHIFT determines the page size
100  boundary_size等于@a is a power of 2 value ((u64)dma_get_seg_boundary(dev) + 1, PAGE_SIZE)右移PAGE_SHIFT determines the page size
103  spin_lock_irqsave( & Allocation bitmap for the remapping area: , flags)
104  offset等于iommu_area_alloc(Guarded by iommu_bitmap_lock: , .. and in pages , protected by iommu_bitmap_lock , size, base_index, boundary_size, align_mask)
106  如果offset恒等于负1则
107  global flush state. set for each gart wrap = true
108  offset等于iommu_area_alloc(Guarded by iommu_bitmap_lock: , .. and in pages , 0, size, base_index, boundary_size, align_mask)
112  如果offset不等于负1则
113  protected by iommu_bitmap_lock 等于offsetsize
119  如果If this is disabled the IOMMU will use an optimized flushing strategy* of only flushing when an mapping is reusedglobal flush state. set for each gart wrap = true
121  spin_unlock_irqrestore( & Allocation bitmap for the remapping area: , flags)
123  返回:offset
调用者
名称描述
dma_map_areaMap a single continuous physical area into the IOMMU.* Caller needs to check if the iommu is needed and flush.
__dma_map_contMap multiple scatterlist entries continuous into the first.