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:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static dma_addr_t dma_map_area(struct device *dev, dma_addr_t phys_mem, size_t size, int dir, unsigned long align_mask)

Type:dma_addr_t

Parameter:

TypeParameterName
struct device *dev
dma_addr_tphys_mem
size_tsize
intdir
unsigned longalign_mask
203  npages = iommu_num_pages(phys_mem, size, PAGE_SIZE)
207  If Value for the false possibility is greater at compile time(phys_mem + size > GART can only remap to physical addresses < 1TB ) Then Return DMA_MAPPING_ERROR
210  iommu_page = alloc_iommu(dev, npages, align_mask)
211  If iommu_page == -1 Then
212  If Not nonforced_iommu(dev, phys_mem, size) Then Return phys_mem
214  If panic_on_overflow Then panic - 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  Return DMA_MAPPING_ERROR
220  When i < npages cycle
221  Remapping table [iommu_page + i] = GPTE_ENCODE(phys_mem)
222  phys_mem += PAGE_SIZE
224  Return GART remapping area (physical) + iommu_page * PAGE_SIZE + (phys_mem & ~PAGE_MASK)
Caller
NameDescribe
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