Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\dma\swiotlb.c Create Date:2022-07-28 10:36:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Bounce: copy the swiotlb buffer from or back to the original dma location

Proto:static void swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir)

Type:void

Parameter:

TypeParameterName
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  If PageHighMem(pfn_to_page(pfn)) Then
416  offset = orig_addr & ~PAGE_MASK
418  sz = 0
421  When size cycle
426  If dir == DMA_TO_DEVICE Then No 3D Now!(vaddr, buffer + offset, sz)
428  Else No 3D Now!(buffer + offset, vaddr, sz)
433  size -= sz
434  pfn++
435  vaddr += sz
436  offset = 0
438  Else if dir == DMA_TO_DEVICE Then
439  No 3D Now!(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  Else
441  No 3D Now!(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)
Caller
NameDescribe
swiotlb_tbl_map_single
swiotlb_tbl_unmap_singlelb_addr is the physical address of the bounce buffer to unmap.
swiotlb_tbl_sync_single