函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\sparse.c Create Date:2022-07-27 17:08:12
Last Modify:2020-03-17 22:36:03 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:sparse_add_section - add a memory section, or populate an existing one*@nid: The node to add section on*@start_pfn: start pfn of the memory range*@nr_pages: number of pfns to add in the section*@altmap: device page map* This is only intended for hotplug

函数原型:int __meminit sparse_add_section(int nid, unsigned long start_pfn, unsigned long nr_pages, struct vmem_altmap *altmap)

返回类型:int

参数:

类型参数名称
intnid
unsigned longstart_pfn
unsigned longnr_pages
struct vmem_altmap *altmap
872  section_nr等于pfn_to_section_nr(start_pfn)
877  ret等于sparse_index_init(section_nr, nid)
878  如果ret小于0则返回:ret
881  memmap等于section_activate(nid, start_pfn, nr_pages, altmap)
882  如果是错误则返回:错误
889  page_init_poison(memmap, sizeof(structpage) * nr_pages)
891  ms等于__nr_to_section(section_nr)
892  set_section_nid(section_nr, nid)
893  section_mark_present(ms)
896  如果section_nr_to_pfn(section_nr)不等于start_pfnmemmap等于pfn_to_kaddr(section_nr_to_pfn(section_nr))
898  sparse_init_one_section(ms, section_nr, memmap, usage, 0)
900  返回:0