函数逻辑报告 |
Source Code:mm\percpu.c |
Create Date:2022-07-27 15:51:07 |
| Last Modify:2022-05-23 13:52:24 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:pcpu_alloc_first_chunk - creates chunks that serve the first chunk*@tmp_addr: the start of the region served*@map_size: size of the region served* This is responsible for creating the chunks that serve the first chunk
函数原型:static struct pcpu_chunk *__init pcpu_alloc_first_chunk(unsigned long tmp_addr, int map_size)
返回类型:struct pcpu_chunk
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| unsigned long | tmp_addr | |
| int | map_size |
| 1317 | aligned_addr等于tmp_addr按位与PAGE_MASK |
| 1319 | start_offset等于tmp_addr减aligned_addr |
| 1330 | alloc_size等于sizeof(structpcpu_chunk)加BITS_TO_LONGS(region_size >> PAGE_SHIFT determines the page size ) |
| 1332 | chunk等于memblock_alloc(alloc_size, SMP_CACHE_BYTES) |
| 1333 | 如果非chunk则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
| 1337 | 初始化链表头 |
| 1341 | additional area required to have the region end page aligned 等于region_size减 the overlap with the previous region to have a page aligned base_addr 减map_size |
| 1346 | alloc_size等于BITS_TO_LONGS(region_bits)乘 allocation map [0]的长度 |
| 1348 | 如果非 allocation map 则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
| 1352 | alloc_size等于BITS_TO_LONGS(region_bits + 1)乘 boundary map [0]的长度 |
| 1355 | 如果非 boundary map 则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
| 1361 | 如果非 metadata blocks 则panic - halt the system*@fmt: The text string to print* Display a message, then perform cleanups.* This function never returns. |
| 1365 | pcpu_init_md_blocks(chunk) |
| 1368 | no [de]population allowed = true |
| 1373 | free bytes in the chunk 等于map_size |
| 1377 | offset_bits等于 the overlap with the previous region to have a page aligned base_addr 除PCPU_MIN_ALLOC_SIZE |
| 1378 | bitmap_set( allocation map , 0, offset_bits) |
| 1379 | 设置内存位 |
| 1380 | 设置内存位 |
| 1389 | offset_bits等于 additional area required to have the region end page aligned 除PCPU_MIN_ALLOC_SIZE |
| 1393 | 设置内存位 |
| 1395 | 设置内存位 |
| 1401 | 返回:chunk |
| 名称 | 描述 |
|---|---|
| pcpu_setup_first_chunk | pcpu_setup_first_chunk - initialize the first percpu chunk*@ai: pcpu_alloc_info describing how to percpu area is shaped*@base_addr: mapped address* Initialize the first percpu chunk which contains the kernel static* percpu area |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |