函数逻辑报告 |
Source Code:kernel\dma\swiotlb.c |
Create Date:2022-07-27 11:36:03 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:swiotlb_tbl_map_single
函数原型:phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, dma_addr_t tbl_dma_addr, phys_addr_t orig_addr, size_t mapping_size, size_t alloc_size, enum dma_data_direction dir, unsigned long attrs)
返回类型:phys_addr_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct device * | hwdev | |
dma_addr_t | tbl_dma_addr | |
phys_addr_t | orig_addr | |
size_t | mapping_size | |
size_t | alloc_size | |
enum dma_data_direction | dir | |
unsigned long | attrs |
462 | 如果no_iotlb_memory则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
465 | 如果mem_encrypt_active()则pr_warn_once("Memory encryption is active and system is using DMA bounce buffers\n") |
468 | 如果mapping_size大于alloc_size则 |
469 | dev_warn_once(hwdev, "Invalid sizes (mapping: %zd bytes, alloc: %zd bytes)", mapping_size, alloc_size) |
471 | 返回:DMA_MAPPING_ERROR |
474 | mask等于dma_get_seg_boundary(hwdev) |
476 | tbl_dma_addr与等于mask |
492 | 如果alloc_size大于等于PAGE_SIZE则stride等于1左移PAGE_SHIFT determines the page size 减log of the size of each IO TLB slab. The number of slabs is command line* controllable.位 |
494 | 否则stride等于1 |
509 | 如果index大于等于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.则index等于0 |
513 | 循环 |
529 | count等于0 |
531 | 以i小于index加nslots循环This is a free list describing the number of free entries available from* each index[i]等于0 |
541 | io_tlb_index等于如果index加nslots小于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.则index加nslots否则0 |
544 | 转到:found |
551 | not_found : |
555 | 如果非attrs按位与DMA_ATTR_NO_WARN: This tells the DMA-mapping subsystem to suppress* allocation failure reports (similarly to __GFP_NOWARN).的值且printk_ratelimit()则dev_warn(hwdev, "swiotlb buffer is full (sz: %zd bytes), total %lu (slots), used %lu (slots)\n", alloc_size, 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., tmp_io_tlb_used) |
558 | 返回:DMA_MAPPING_ERROR |
559 | found : |
568 | 以i小于nslots循环io_tlb_orig_addr[index + i]等于orig_addr加i左移log of the size of each IO TLB slab. The number of slabs is command line* controllable.位的值 |
574 | 返回:tlb_addr |
名称 | 描述 |
---|---|
swiotlb_map | Create a swiotlb mapping for the buffer at @phys, and in case of DMAing* to the device copy the data into it as well. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |