函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ma_init_reserved_mem() - create custom contiguous area from reserved memory*@base: Base address of the reserved area*@size: Size of the reserved area (in bytes),*@order_per_bit: Order of pages represented by one bit on bitmap.*@name: The name of the area

函数原型:int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size, unsigned int order_per_bit, const char *name, struct cma **res_cma)

返回类型:int

参数:

类型参数名称
phys_addr_tbase
phys_addr_tsize
unsigned intorder_per_bit
const char *name
struct cma **res_cma
181  如果cma_area_count恒等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(cma_areas)则
182  打印错误信息("Not enough slots for CMA reserved regions!\n")
183  返回:负ENOSPC
186  如果非size或非memblock_is_region_reserved(base, size)则返回:负EINVAL
190  alignment等于PAGE_SIZE左移max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(unsignedlong, Free memory management - zoned buddy allocator. - 1, Huge pages are a constant size )位
194  如果非IS_ALIGNED(alignment >> PAGE_SHIFT determines the page size , 1 << order_per_bit)则返回:负EINVAL
197  如果@a is a power of 2 value (base, alignment)不等于base@a is a power of 2 value (size, alignment)不等于size则返回:负EINVAL
204  cma等于cma_areas[cma_area_count]
205  如果name
206  name等于name
207  否则
208  name等于kasprintf(GFP_KERNEL, "cma%d\n", cma_area_count)
209  如果非name则返回:负ENOMEM
212  base_pfn等于PFN_DOWN(base)
213  count等于size右移PAGE_SHIFT determines the page size
214  Order of pages represented by one bit 等于order_per_bit
215  res_cma等于cma
216  cma_area_count自加
217  totalcma_pages加等于sizePAGE_SIZE
219  返回:0
调用者
名称描述
cma_declare_contiguousma_declare_contiguous() - reserve custom contiguous area*@base: Base address of the reserved area optional, use 0 for any*@size: Size of the reserved area (in bytes),*@limit: End address of the reserved memory (optional, 0 for any)