函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:dma_direct_get_sgtable

函数原型:int dma_direct_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr, dma_addr_t dma_addr, size_t size, unsigned long attrs)

返回类型:int

参数:

类型参数名称
struct device *dev
struct sg_table *sgt
void *cpu_addr
dma_addr_tdma_addr
size_tsize
unsigned longattrs
426  page等于dma_direct_to_page(dev, dma_addr)
429  ret等于sg_alloc_table - Allocate and initialize an sg table*@table: The sg table header to use*@nents: Number of entries in sg list*@gfp_mask: GFP allocation mask* Description:* Allocate and initialize an sg table. If @nents@ is larger than
430  如果非retsg_set_page - Set sg entry to point at given page*@sg: SG entry*@page: The page*@len: Length of data*@offset: Offset into page* Description:* Use this function to set an sg entry pointing at a page, never assign* the page directly
432  返回:ret
调用者
名称描述
dma_get_sgtable_attrsThe 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