函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:memblock_add_range

函数原型:int __attribute__((__section__(".meminit.text"))) __attribute__((__cold__)) __attribute__((__no_instrument_function__))memblock_add_range(struct memblock_type *type, phys_addr_t base, phys_addr_t size, int nid, enum memblock_flags flags)

返回类型:int

参数:

类型参数名称
struct memblock_type *type
phys_addr_tbase
phys_addr_tsize
intnid
enum memblock_flagsflags
582  bool insert = false
583  obase等于base
584  end等于baseadjust *@size so that (@base + *@size) doesn't overflow, return new size
588  如果非size则返回:0
592  如果size恒等于0则
593  WARN_ON(cnt != 1 || total_size)
594  base等于base
595  size等于size
596  flags等于flags
597  memblock_set_region_node( & regions[0], nid)
598  total_size等于size
599  返回:0
601  repeat :
607  base等于obase
608  nr_new等于0
611  rbase等于base
612  rend等于rbasesize
614  如果rbase大于等于end退出
616  如果rend小于等于base则继续下一循环
622  如果rbase大于base
626  WARN_ON(flags != flags)
627  nr_new自加
628  如果insertmemblock_insert_region(type, idx++, base, rbase - base, nid, flags)
634  base等于两数取小(rend, end)
638  如果base小于end
639  nr_new自加
640  如果insertmemblock_insert_region(type, idx, base, end - base, nid, flags)
645  如果非nr_new则返回:0
652  如果非insert
653 cntnr_new大于max循环
654  如果memblock_double_array - double the size of the memblock regions array*@type: memblock type of the regions array being doubled*@new_area_start: starting address of memory range to avoid overlap with*@new_area_size: size of memory range to avoid overlap with小于0则返回:负ENOMEM
656  insert = true
657  转到:repeat
658  否则
659  memblock_merge_regions(type)
660  返回:0
调用者
名称描述
memblock_add_node
memblock_add
memblock_reserve