函数逻辑报告 |
Source Code:mm\vmalloc.c |
Create Date:2022-07-27 16:29:11 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:vb_alloc
函数原型:static void *vb_alloc(unsigned long size, gfp_t gfp_mask)
返回类型:void
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| unsigned long | size | |
| gfp_t | gfp_mask |
| 1610 | void * vaddr = NULL |
| 1613 | BUG_ON(offset_in_page(size)) |
| 1614 | BUG_ON(size > PAGE_SIZE * 256K with 4K pages ) |
| 1621 | 返回:NULL |
| 1623 | order等于get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory |
| 1626 | vbq等于Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(Queue of free and dirty vmap blocks, for allocation and flushing purposes ) |
| 1630 | 加自旋锁 |
| 1632 | 自旋锁解锁 |
| 1633 | 继续下一循环 |
| 1636 | pages_off等于VMAP_BBMAP_BITS减free |
| 1637 | vaddr等于vmap_block_vaddr(va_start, pages_off) |
| 1639 | 如果free恒等于0则 |
| 1645 | 自旋锁解锁 |
| 1646 | 退出 |
| 1649 | The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(Queue of free and dirty vmap blocks, for allocation and flushing purposes ) |
| 1653 | 如果非vaddr则vaddr等于w_vmap_block - allocates new vmap_block and occupies 2^order pages in this* block |
| 1656 | 返回:vaddr |
| 名称 | 描述 |
|---|---|
| vm_map_ram | vm_map_ram - map pages linearly into kernel virtual address (vmalloc space)*@pages: an array of pointers to the pages to be mapped*@count: number of pages*@node: prefer to allocate data structures on this node*@prot: memory protection to use |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |