Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmalloc.c Create Date:2022-07-28 14:59:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot)

Type:void

Parameter:

TypeParameterName
struct page **pages
unsigned intcount
intnode
pgprot_tprot
1815  size = count << PAGE_SHIFT determines the page size
1819  If Value is more likely to compile time(count <= 256K with 4K pages ) Then
1820  mem = vb_alloc(size, GFP_KERNEL)
1821  If IS_ERR(mem) Then Return NULL
1823  addr = mem
1824  Else
1826  va = Allocate a region of KVA of the specified size and alignment, within the* vstart and vend.
1828  If IS_ERR(va) Then Return NULL
1831  addr = va_start
1832  mem = addr
1835  kasan_unpoison_vmalloc(mem, size)
1837  If vmap_page_range(addr, addr + size, prot, pages) < 0 Then
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  Return NULL
1841  Return mem