Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:memblock_add_range

Proto: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)

Type:int

Parameter:

TypeParameterName
struct memblock_type *type
phys_addr_tbase
phys_addr_tsize
intnid
enum memblock_flagsflags
582  bool insert = false
583  obase = base
584  end = base + adjust *@size so that (@base + *@size) doesn't overflow, return new size
588  If Not size Then Return 0
592  If size == 0 Then
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  Return 0
601  repeat :
607  base = obase
608  nr_new = 0
611  rbase = base
612  rend = rbase + size
614  If rbase >= end Then Break
616  If rend <= base Then Continue
622  If rbase > base Then
626  WARN_ON(flags != flags)
627  nr_new++
628  If insert Then memblock_insert_region(type, idx++, base, rbase - base, nid, flags)
634  base = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(rend, end)
638  If base < end Then
639  nr_new++
640  If insert Then memblock_insert_region(type, idx, base, end - base, nid, flags)
645  If Not nr_new Then Return 0
652  If Not insert Then
653  When cnt + nr_new > max cycle
654  If 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 Then Return -ENOMEM
656  insert = true
657  Go to repeat
658  Else
659  memblock_merge_regions(type)
660  Return 0
Caller
NameDescribe
memblock_add_node
memblock_add
memblock_reserve