函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swiotlb_tbl_sync_single

函数原型:void swiotlb_tbl_sync_single(struct device *hwdev, phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target)

返回类型:void

参数:

类型参数名称
struct device *hwdev
phys_addr_ttlb_addr
size_tsize
enum dma_data_directiondir
enum dma_sync_targettarget
631  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.
632  orig_addr等于io_tlb_orig_addr[index]
634  如果orig_addr恒等于We need to save away the original address corresponding to a mapped entry* for the sync operations.则返回
636  orig_addr加等于tlb_addr按位与1左移log of the size of each IO TLB slab. The number of slabs is command line* controllable.位的值减1
639  :target恒等于SYNC_FOR_CPU
640  如果此条件成立可能性大(为编译器优化)(dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL)则Bounce: copy the swiotlb buffer from or back to the original dma location
643  否则BUG_ON(dir != DMA_TO_DEVICE)
645  退出
646  :target恒等于SYNC_FOR_DEVICE
647  如果此条件成立可能性大(为编译器优化)(dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL)则Bounce: copy the swiotlb buffer from or back to the original dma location
650  否则BUG_ON(dir != DMA_FROM_DEVICE)
652  退出
653  默认
654  BUG()