函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot)

返回类型:void

参数:

类型参数名称
struct page **pages
unsigned intcount
intnode
pgprot_tprot
1815  size等于count左移PAGE_SHIFT determines the page size
1819  如果此条件成立可能性大(为编译器优化)(count <= 256K with 4K pages )则
1820  mem等于vb_alloc(size, GFP_KERNEL)
1821  如果是错误则返回:NULL
1823  addr等于mem
1824  否则
1826  va等于Allocate a region of KVA of the specified size and alignment, within the* vstart and vend.
1828  如果是错误则返回:NULL
1831  addr等于va_start
1832  mem等于addr
1835  kasan_unpoison_vmalloc(mem, size)
1837  如果vmap_page_range(addr, addr + size, prot, pages)小于0则
1838  vm_unmap_ram - unmap linear kernel address space set up by vm_map_ram*@mem: the pointer returned by vm_map_ram*@count: the count passed to that vm_map_ram call (cannot unmap partial)
1839  返回:NULL
1841  返回:mem