函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swiotlb_late_init_with_tbl

函数原型:int swiotlb_late_init_with_tbl(char *tlb, unsigned long nslabs)

返回类型:int

参数:

类型参数名称
char *tlb
unsigned longnslabs
333  bytes等于nslabs左移log of the size of each IO TLB slab. The number of slabs is command line* controllable.
335  The number of IO TLB blocks (in groups of 64) between io_tlb_start and* io_tlb_end. This is command line adjustable via setup_io_tlb_npages.等于nslabs
336  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.等于virt_to_phys - map virtual addresses to physical*@address: address to remap* The returned physical address is the physical (CPU) mapping for* the memory address given. It is only valid to use this function on
337  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.等于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.bytes
339  set_memory_decrypted((unsignedlong)tlb, bytes >> PAGE_SHIFT determines the page size )
340  memset(tlb, 0, bytes)
347  This is a free list describing the number of free entries available from* each index等于__get_free_pages(GFP_KERNEL, get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory)
349  如果非This is a free list describing the number of free entries available from* each index则转到:cleanup3
352  io_tlb_orig_addr等于__get_free_pages(GFP_KERNEL, get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory)
356  如果非io_tlb_orig_addr则转到:cleanup4
359 i小于The number of IO TLB blocks (in groups of 64) between io_tlb_start and* io_tlb_end. This is command line adjustable via setup_io_tlb_npages.循环
360  This is a free list describing the number of free entries available from* each index[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.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.)
361  io_tlb_orig_addr[i]等于We need to save away the original address corresponding to a mapped entry* for the sync operations.
363  io_tlb_index等于0
365  swiotlb_print_info()
367  late_alloc等于1
369  swiotlb_set_max_segment(The number of IO TLB blocks (in groups of 64) between io_tlb_start and* io_tlb_end. This is command line adjustable via setup_io_tlb_npages. << log of the size of each IO TLB slab. The number of slabs is command line* controllable.)
371  返回:0
373  cleanup4 :
374  free_pages((unsignedlong)This is a free list describing the number of free entries available from* each index, get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory)
376  This is a free list describing the number of free entries available from* each index = NULL
377  cleanup3 :
378  swiotlb_cleanup()
379  返回:负ENOMEM
调用者
名称描述
swiotlb_late_init_with_default_sizeSystems with larger DMA zones (those that don't support ISA) can* initialize the swiotlb later using the slab allocator if needed.* This should be just like above, but with some error catching.