函数逻辑报告

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

函数名称:allocate and map a coherent mapping

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

返回类型:void

参数:

类型参数名称
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  如果非vaddr或非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)则返回: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  如果此条件成立可能性小(为编译器优化)( * dma_addr == DMA_MAPPING_ERROR)则转到:out_free
482  返回:vaddr
483  out_free :
484  dma_direct_free_pages(dev, size, vaddr, * dma_addr, attrs)
485  返回:NULL