Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The whole dma_get_sgtable() idea is fundamentally unsafe - it seems* that the intention is to allow exporting memory allocated via the* coherent DMA APIs through the dma_buf API, which only accepts a* scattertable. This presents a couple of problems:* 1

Proto:int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size, unsigned long attrs)

Type:int

Parameter:

TypeParameterName
struct device *dev
struct sg_table *sgt
void *cpu_addr
dma_addr_tdma_addr
size_tsize
unsigned longattrs
139  ops = get_dma_ops(dev)
141  If dma_is_direct(ops) Then Return dma_direct_get_sgtable(dev, sgt, cpu_addr, dma_addr, size, attrs)
144  If Not get_sgtable Then Return -ENXIO
146  Return get_sgtable(dev, sgt, cpu_addr, dma_addr, size, attrs)