d750211a65
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> |
||
---|---|---|
.. | ||
arch/x86 | ||
net | ||
platform | ||
addr_range.h | ||
arch.h | ||
bootdir.h | ||
disk_identifier.h | ||
driver_settings.h | ||
elf.h | ||
FileMapDisk.h | ||
heap.h | ||
images-sans-tm.h | ||
images-tm-development.h | ||
images-tm.h | ||
images.h | ||
kernel_args.h | ||
menu.h | ||
partitions.h | ||
PathBlacklist.h | ||
platform.h | ||
stage2_args.h | ||
stage2.h | ||
stdio.h | ||
vfs.h |