函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:dma_pool_alloc - get a block of consistent memory*@pool: dma pool that will produce the block*@mem_flags: GFP_* bitmask*@handle: pointer to dma address of block* Return: the kernel virtual address of a currently unused block,

函数原型:void *dma_pool_alloc(struct dma_pool *pool, gfp_t mem_flags, dma_addr_t *handle)

返回类型:void

参数:

类型参数名称
struct dma_pool *pool
gfp_tmem_flags
dma_addr_t *handle
327  might_sleep_if(gfpflags_allow_blocking(mem_flags))
329  spin_lock_irqsave( & lock, flags)
331  如果offset小于allocation则转到:ready
336  spin_unlock_irqrestore( & lock, flags)
338  page等于pool_alloc_page(pool, mem_flags & (~__GFP_ZERO))
339  如果非page则返回:NULL
342  spin_lock_irqsave( & lock, flags)
344  添加链表项
345  ready :
346  in_use自加
347  offset等于offset
348  offset等于*vaddroffset的和
349  retval等于offsetvaddr
350  handle等于offsetdma
379  spin_unlock_irqrestore( & lock, flags)
381  如果want_init_on_alloc(mem_flags)则memset(retval, 0, size)
384  返回:retval