Function report | 
Source Code:mm\cma.c | 
Create Date:2022-07-28 16:31:57 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:ma_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)
Proto:int __init cma_declare_contiguous(phys_addr_t base, phys_addr_t size, phys_addr_t limit, phys_addr_t alignment, unsigned int order_per_bit, bool fixed, const char *name, struct cma **res_cma)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| phys_addr_t | base | |
| phys_addr_t | size | |
| phys_addr_t | limit | |
| phys_addr_t | alignment | |
| unsigned int | order_per_bit | |
| bool | fixed | |
| const char * | name | |
| struct cma ** | res_cma | 
| 246 | memblock_end = memblock_end_of_DRAM() | 
| 248 | ret = 0 | 
| 256 | highmem_start = __pa(A number of key systems in x86 including ioremap() rely on the assumption* that high_memory defines the upper bound on direct map memory, then end* of ZONE_NORMAL - 1) + 1 | 
| 257 | pr_debug("%s(size %pa, base %pa, limit %pa alignment %pa)\n", __func__, & size, & base, & limit, & alignment) | 
| 283 | Go to err | 
| 285 | base = @a is a power of 2 value (base, alignment) | 
| 286 | size = @a is a power of 2 value (size, alignment) | 
| 293 | If Not IS_ALIGNED(size >> PAGE_SHIFT determines the page size , 1 << order_per_bit) Then Return -EINVAL | 
| 300 | If fixed && base < highmem_start && base + size > highmem_start Then | 
| 302 | pr_err("Region at %pa defined on low/high memory boundary (%pa)\n", & base, & highmem_start) | 
| 304 | Go to err | 
| 312 | If limit == 0 || limit > memblock_end Then limit = memblock_end | 
| 319 | Go to err | 
| 323 | If fixed Then | 
| 324 | If memblock_is_region_reserved(base, size) || memblock_reserve(base, size) < 0 Then | 
| 329 | Else | 
| 330 | addr = 0 | 
| 338 | If base < highmem_start && limit > highmem_start Then | 
| 341 | limit = highmem_start | 
| 344 | If Not addr Then | 
| 367 | Return 0 | 
| 369 | free_mem : | 
| 370 | memblock_free(base, size) | 
| 371 | err : | 
| 373 | Return ret | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |