函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\mapping.c Create Date:2022-07-27 11:32:33
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:dma_alloc_attrs

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

返回类型:void

参数:

类型参数名称
struct device *dev
size_tsize
dma_addr_t *dma_handle
gfp_tflag
unsigned longattrs
267  ops等于get_dma_ops(dev)
270  WARN_ON_ONCE(! Like dma_mask, but for alloc_coherent mappings as not all hardware supports 64 bit addresses for consistent allocations such descriptors. )
272  如果dma_alloc_from_dev_coherent(dev, size, dma_handle, & cpu_addr)则返回:cpu_addr
276  flag与等于Physical address zone modifiers (see linux/mmzone.h - low four bits)* Do not put any conditional on these. If necessary modify the definitions* without the underscores and use them consistently. The definitions here may* be used in bit comparisons.按位或__GFP_DMA32按位或__GFP_HIGHMEM的值的反
278  如果dma_is_direct(ops)则cpu_addr等于dma_direct_alloc(dev, size, dma_handle, flag, attrs)
280  否则如果alloccpu_addr等于alloc(dev, size, dma_handle, flag, attrs)
282  否则返回:NULL
285  debug_dma_alloc_coherent(dev, size, * dma_handle, cpu_addr)
286  返回:cpu_addr
调用者
名称描述
dmam_alloc_attrsdmam_alloc_attrs - Managed dma_alloc_attrs()*@dev: Device to allocate non_coherent memory for*@size: Size of allocation*@dma_handle: Out argument for allocated DMA handle*@gfp: Allocation flags*@attrs: Flags in the DMA_ATTR_* namespace.
dma_alloc_coherent
dma_alloc_wc