函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lb_addr is the physical address of the bounce buffer to unmap.

函数原型:void swiotlb_tbl_unmap_single(struct device *hwdev, phys_addr_t tlb_addr, size_t mapping_size, size_t alloc_size, enum dma_data_direction dir, unsigned long attrs)

返回类型:void

参数:

类型参数名称
struct device *hwdev
phys_addr_ttlb_addr
size_tmapping_size
size_talloc_size
enum dma_data_directiondir
unsigned longattrs
585  nslots等于@a is a power of 2 value (alloc_size, 1 << log of the size of each IO TLB slab. The number of slabs is command line* controllable.)右移log of the size of each IO TLB slab. The number of slabs is command line* controllable.
586  index等于tlb_addrUsed 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.右移log of the size of each IO TLB slab. The number of slabs is command line* controllable.
587  orig_addr等于io_tlb_orig_addr[index]
592  如果orig_addr不等于We need to save away the original address corresponding to a mapped entry* for the sync operations.且非attrs按位与DMA_ATTR_SKIP_CPU_SYNC: Allows platform code to skip synchronization of* the CPU cache for the given buffer assuming that it has been already* transferred to 'device' domain.的值且dir恒等于DMA_FROM_DEVICEdir恒等于DMA_BIDIRECTIONAL的值则Bounce: copy the swiotlb buffer from or back to the original dma location
603  spin_lock_irqsave( & Protect the above data structures in the map and unmap calls, flags)
605  count等于如果indexnslots小于@a is a power of 2 value (index + 1, Maximum allowable number of contiguous slabs to map,* must be a power of 2. What is the appropriate value ?* The complexity of {map,unmap}_single is linearly dependent on this value.)则This is a free list describing the number of free entries available from* each index[index + nslots]否则0
611 i大于等于index循环
619 OFFSET(i, Maximum allowable number of contiguous slabs to map,* must be a power of 2. What is the appropriate value ?* The complexity of {map,unmap}_single is linearly dependent on this value.)不等于Maximum allowable number of contiguous slabs to map,* must be a power of 2. What is the appropriate value ?* The complexity of {map,unmap}_single is linearly dependent on this value.减1且This is a free list describing the number of free entries available from* each index[i]循环This is a free list describing the number of free entries available from* each index[i]等于count先自加
622  The number of used IO TLB block减等于nslots
624  spin_unlock_irqrestore( & Protect the above data structures in the map and unmap calls, flags)
调用者
名称描述
swiotlb_mapCreate a swiotlb mapping for the buffer at @phys, and in case of DMAing* to the device copy the data into it as well.