Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\dmapool.c Create Date:2022-07-28 15:24:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:dma_pool_create - Creates a pool of consistent memory blocks, for dma

Proto:struct dma_pool *dma_pool_create(const char *name, struct device *dev, size_t size, size_t align, size_t boundary)

Type:struct dma_pool

Parameter:

TypeParameterName
const char *name
struct device *dev
size_tsize
size_talign
size_tboundary
135  bool empty = false
137  If align == 0 Then align = 1
139  Else if align & align - 1 Then Return NULL
142  If size == 0 Then Return NULL
144  Else if size < 4 Then size = 4
147  If size % align != 0 Then 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  If Not boundary Then boundary = allocation
154  Else if boundary < size || boundary & boundary - 1 Then Return NULL
157  retval = kmalloc_node( size of retval , GFP_KERNEL, dev_to_node(dev))
158  If Not retval Then Return retval
161  Copy a NUL terminated string into a sized buffer
163  dev = dev
165  Initialization list head
166  Process spin lock initialization( & lock)
167  size = size
168  boundary = boundary
169  allocation = allocation
171  Initialization list head
181  mutex_lock( & pools_reg_lock)
182  mutex_lock( & pools_lock)
183  If list_empty - tests whether a list is empty*@head: the list to test. Then empty = true
185  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
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  If empty Then
190  err = device_create_file(dev, & dev_attr_pools)
191  If err Then
196  kfree(retval)
197  Return 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  Return retval
Caller
NameDescribe
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