Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Remove a range of memory from the E820 table:

Proto:u64 __init e820__range_remove(u64 start, u64 size, enum e820_type old_type, bool check_type)

Type:u64

Parameter:

TypeParameterName
u64start
u64size
enum e820_typeold_type
boolcheck_type
531  real_removed_size = 0
533  If size > ULLONG_MAX - start Then size = ULLONG_MAX - start
536  end = start + size
537  printk(debug-level messages "e820: remove [mem %#010Lx-%#010Lx] ", start, end - 1)
538  If check_type Then e820_print_type(old_type)
540  Like KERN_CONT, pr_cont() should only be used when continuing* a line with no newline ('\n') enclosed. Otherwise it defaults* back to KERN_DEFAULT.("\n")
542  When i < nr_entries cycle
543  entry = entries[i]
547  If check_type && type != old_type Then Continue
550  entry_end = addr + size
553  If addr >= start && entry_end <= end Then
555  memset(entry, 0, size of entry )
556  Continue
560  If addr < start && entry_end > end Then
562  size = start - addr
564  Continue
568  final_start = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(start, addr)
569  final_end = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(end, entry_end)
570  If final_start >= final_end Then Continue
573  real_removed_size += final_end - final_start
579  size -= final_end - final_start
580  If addr < final_start Then Continue
583  addr = final_end
585  Return real_removed_size
Caller
NameDescribe
e820_add_kernel_rangealled before trim_bios_range() to spare extra sanitize
parse_memoptThe "mem=nopentium" boot option disables 4MB page tables on 32-bit kernels:
parse_memmap_one