函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Bounce: copy the swiotlb buffer from or back to the original dma location

函数原型:static void swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir)

返回类型:void

参数:

类型参数名称
phys_addr_torig_addr
phys_addr_ttlb_addr
size_tsize
enum dma_data_directiondir
411  pfn等于PFN_DOWN(orig_addr)
412  vaddr等于phys_to_virt - map physical address to virtual*@address: address to remap* The returned virtual address is a current CPU mapping for* the memory address given. It is only valid to use this function on* addresses that have a kernel mapping
414  如果PageHighMem(pfn_to_page(pfn))则
416  offset等于orig_addr按位与PAGE_MASK的反
418  sz等于0
421 size循环
426  如果dir恒等于DMA_TO_DEVICE内存复制(vaddr, buffer + offset, sz)
428  否则内存复制(buffer + offset, vaddr, sz)
433  size减等于sz
434  pfn自加
435  vaddr加等于sz
436  offset等于0
438  否则如果dir恒等于DMA_TO_DEVICE
439  内存复制(vaddr, phys_to_virt - map physical address to virtual*@address: address to remap* The returned virtual address is a current CPU mapping for* the memory address given. It is only valid to use this function on* addresses that have a kernel mapping, size)
440  否则
441  内存复制(phys_to_virt - map physical address to virtual*@address: address to remap* The returned virtual address is a current CPU mapping for* the memory address given. It is only valid to use this function on* addresses that have a kernel mapping, vaddr, size)
调用者
名称描述
swiotlb_tbl_map_single
swiotlb_tbl_unmap_singlelb_addr is the physical address of the bounce buffer to unmap.
swiotlb_tbl_sync_single