haiku/headers/private/kernel/boot
Michael Lotz d750211a65 bootloader: Split memory map handling into add/remove passes.
The memory map may be unordered and include overlapping ranges. To make
sure that nothing gets included as usable that should actually be
excluded, first scan for all usable ranges and add them, then remove
anything unusable from these ranges again.

To calculate the amount of unusable memory, count the total after the
first pass and then subtract the total after the second. This way, only
unusable ranges that actually overlap physical memory (and therefore
reduce the amount of usable memory) get excluded.

Note that the explicit ignore of the ACPI reclaim memory is subsumed by
the above. We still don't want to add this region to the usable memory
map, as that would allow the kernel to allocate pages into that region,
possibly corrupting ACPI tables before they were used. We also don't
want to add it as an allocated range, as it is not guaranteed that ACPI
is done with the tables before the unused bootloader ranges are freed in
the kernel.

Also add the missing unusable memory amount from ignoring the first MiB
of memory in the EFI loader.

May fix #16056 although it is not certain that graphics memory ranges
are actually included in the memory map.

Change-Id: Ie7991d2c4dcd988edac2995b3a7efc509fa0f4a3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2814
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-05-26 04:04:35 +00:00
..
arch/x86 boot_loader: load intel microcode update data file 2020-03-23 15:33:34 +00:00
net bootloader: Add the network endianness macros to NetDefs.h. 2019-03-26 21:51:42 -04:00
platform efi: Cleanup arch_mmu, drop extra arch_timer.h 2020-02-22 22:15:08 +00:00
addr_range.h bootloader: Split memory map handling into add/remove passes. 2020-05-26 04:04:35 +00:00
arch.h system: Build using public elf.h header 2015-11-07 11:49:56 +13:00
bootdir.h
disk_identifier.h Added missing packed attributes on disk_identifier. 2012-07-20 17:14:17 +01:00
driver_settings.h Forgot to change driver_settings_file to use FixedWidthPointer. 2012-06-26 10:54:37 +01:00
elf.h system: Build using public elf.h header 2015-11-07 11:49:56 +13:00
FileMapDisk.h Convert line endings to LF 2010-06-26 17:38:03 +00:00
heap.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
images-sans-tm.h Switched boot splash compression to use boot_zlib (which was already 2011-01-12 15:43:14 +00:00
images-tm-development.h Updated the header files for the boot splash, to display the registered 2011-05-14 18:59:26 +00:00
images-tm.h Remove glow from boot logo. 2017-07-29 12:27:50 +02:00
images.h Relax the copyright... 2010-10-11 13:39:37 +00:00
kernel_args.h kernel: load cpu microcode update if loaded by the bootloader 2020-03-16 06:41:16 +00:00
menu.h boot loader: Menu: Add SetTitle() 2013-11-30 19:56:26 +01:00
partitions.h loader: Drop the HashMap for partition lookup by id 2016-09-02 19:02:33 +12:00
PathBlacklist.h boot loader: Add safe mode blacklist submenu 2013-11-20 16:00:35 +01:00
platform.h boot_loader: load intel microcode update data file 2020-03-23 15:33:34 +00:00
stage2_args.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
stage2.h s/OpenBeOS License/MIT License/ universally, as they're the same thing. 2017-02-09 22:09:56 -05:00
stdio.h Revert "deprecate gets and tmpnam" 2020-01-04 15:26:08 -05:00
vfs.h Boot loader: Add support for choosing an old packages state 2014-04-18 23:31:39 +02:00