Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\mapping.c Create Date:2022-07-28 10:32:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:dma_alloc_attrs

Proto:void *dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flag, unsigned long attrs)

Type:void

Parameter:

TypeParameterName
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  If dma_alloc_from_dev_coherent(dev, size, dma_handle, & cpu_addr) Then Return 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  If dma_is_direct(ops) Then cpu_addr = dma_direct_alloc(dev, size, dma_handle, flag, attrs)
280  Else if alloc Then cpu_addr = alloc(dev, size, dma_handle, flag, attrs)
282  Else Return NULL
285  debug_dma_alloc_coherent(dev, size, * dma_handle, cpu_addr)
286  Return cpu_addr
Caller
NameDescribe
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