函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\dmapool.c Create Date:2022-07-27 16:54:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:dma_pool_create - Creates a pool of consistent memory blocks, for dma

函数原型:struct dma_pool *dma_pool_create(const char *name, struct device *dev, size_t size, size_t align, size_t boundary)

返回类型:struct dma_pool

参数:

类型参数名称
const char *name
struct device *dev
size_tsize
size_talign
size_tboundary
135  bool empty = false
137  如果align恒等于0则align等于1
139  否则如果align按位与align减1则返回:NULL
142  如果size恒等于0则返回:NULL
144  否则如果size小于4则size等于4
147  如果size取模align不等于0则size等于@a is a power of 2 value (size, align)
150  allocation等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, size, PAGE_SIZE)
152  如果非boundaryboundary等于allocation
154  否则如果boundary小于sizeboundary按位与boundary减1则返回:NULL
157  retval等于kmalloc_node(retval的长度, GFP_KERNEL, dev_to_node(dev))
158  如果非retval则返回:retval
161  长字符串复制
163  dev等于dev
165  初始化链表头
166  spin_lock_init( & lock)
167  size等于size
168  boundary等于boundary
169  allocation等于allocation
171  初始化链表头
181  mutex_lock( & pools_reg_lock)
182  mutex_lock( & pools_lock)
183  如果链表为空empty = true
185  添加链表项
186  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
187  如果empty
190  err等于device_create_file(dev, & dev_attr_pools)
191  如果err
196  释放内存
197  返回:NULL
200  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
201  返回:retval
调用者
名称描述
dmam_pool_createdmam_pool_create - Managed dma_pool_create()*@name: name of pool, for diagnostics*@dev: device that will be doing the DMA*@size: size of the blocks in this pool