函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:dma_init_coherent_memory

函数原型:static int dma_init_coherent_memory(phys_addr_t phys_addr, dma_addr_t device_addr, size_t size, struct dma_coherent_mem **mem)

返回类型:int

参数:

类型参数名称
phys_addr_tphys_addr
dma_addr_tdevice_addr
size_tsize
struct dma_coherent_mem **mem
44  struct dma_coherent_mem * dma_mem = NULL
45  void * mem_base = NULL
46  pages等于size右移PAGE_SHIFT determines the page size
47  bitmap_size等于BITS_TO_LONGS(pages)乘sizeof(long)
50  如果非size
51  ret等于负EINVAL
52  转到:out
55  mem_base等于memremap() - remap an iomem_resource as cacheable memory*@offset: iomem resource start address*@size: size of remap*@flags: any of MEMREMAP_WB, MEMREMAP_WT, MEMREMAP_WC,* MEMREMAP_ENC, MEMREMAP_DEC* memremap() is "ioremap" for cases where it is known that
56  如果非mem_base
57  ret等于负EINVAL
58  转到:out
60  dma_mem等于分配内存并置零
61  如果非dma_mem
62  ret等于负ENOMEM
63  转到:out
65  bitmap等于分配内存并置零
66  如果非bitmap
67  ret等于负ENOMEM
68  转到:out
71  virt_base等于mem_base
72  device_base等于device_addr
73  pfn_base等于PFN_DOWN(phys_addr)
74  size等于pages
75  spin_lock_init( & spinlock)
77  mem等于dma_mem
78  返回:0
80  out :
81  kfree(dma_mem)
82  如果mem_basememunmap(mem_base)
84  返回:ret
调用者
名称描述
dma_declare_coherent_memory