函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Create a swiotlb mapping for the buffer at @phys, and in case of DMAing* to the device copy the data into it as well.

函数原型:bool swiotlb_map(struct device *dev, phys_addr_t *phys, dma_addr_t *dma_addr, size_t size, enum dma_data_direction dir, unsigned long attrs)

返回类型:bool

参数:

类型参数名称
struct device *dev
phys_addr_t *phys
dma_addr_t *dma_addr
size_tsize
enum dma_data_directiondir
unsigned longattrs
665  trace_swiotlb_bounced(dev, * dma_addr, size, swiotlb_force)
667  如果此条件成立可能性小(为编译器优化)(swiotlb_force == swiotlb=noforce )则
668  dev_warn_ratelimited(dev, "Cannot do DMA to address %pa\n", phys)
670  返回:false
674  phys等于swiotlb_tbl_map_single(dev, __phys_to_dma(dev, Used to do a quick range check in swiotlb_tbl_unmap_single and* swiotlb_tbl_sync_single_*, to see if the memory was in fact allocated by this* API.), * phys, size, size, dir, attrs)
676  如果phys恒等于DMA_MAPPING_ERROR则返回:false
680  dma_addr等于__phys_to_dma(dev, * phys)
681  如果此条件成立可能性小(为编译器优化)(!dma_capable(dev, * dma_addr, size, true))则
682  lb_addr is the physical address of the bounce buffer to unmap.
684  返回:false
687  返回:true