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

Name:allocate and map a coherent mapping

Proto:static void *gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, gfp_t flag, unsigned long attrs)

Type:void

Parameter:

TypeParameterName
struct device *dev
size_tsize
dma_addr_t *dma_addr
gfp_tflag
unsigned longattrs
472  vaddr = dma_direct_alloc_pages(dev, size, dma_addr, flag, attrs)
473  If Not vaddr || Not force_iommu || Like dma_mask, but for alloc_coherent mappings as not all hardware supports 64 bit addresses for consistent allocations such descriptors. <= DMA_BIT_MASK(24) Then Return vaddr
477  dma_addr = Map a single continuous physical area into the IOMMU.* Caller needs to check if the iommu is needed and flush.
479  Use global flush state to avoid races with multiple flushers.
480  If Value for the false possibility is greater at compile time( * dma_addr == DMA_MAPPING_ERROR) Then Go to out_free
482  Return vaddr
483  out_free :
484  dma_direct_free_pages(dev, size, vaddr, * dma_addr, attrs)
485  Return NULL