Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\amd_gart_64.c Create Date:2022-07-28 08:52:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_iommu

Proto:static unsigned long alloc_iommu(struct device *dev, int size, unsigned long align_mask)

Type:unsigned long

Parameter:

TypeParameterName
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  If offset == -1 Then
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  If offset != -1 Then
113  protected by iommu_bitmap_lock = offset + size
119  If If this is disabled the IOMMU will use an optimized flushing strategy* of only flushing when an mapping is reused Then global flush state. set for each gart wrap = true
121  spin_unlock_irqrestore( & Allocation bitmap for the remapping area: , flags)
123  Return offset
Caller
NameDescribe
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.