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 | ||
boot | ||
disk_device_manager | ||
fs | ||
platform | ||
posix | ||
slab | ||
util | ||
vm | ||
AllocationTracking.h | ||
AreaKeeper.h | ||
block_cache.h | ||
boot_device.h | ||
boot_item.h | ||
boot_splash.h | ||
commpage_compat.h | ||
commpage.h | ||
condition_variable.h | ||
console.h | ||
core_dump.h | ||
cpu.h | ||
debug_heap.h | ||
debug_hex_dump.h | ||
debug_paranoia.h | ||
debug.h | ||
debugger_keymaps.h | ||
DPC.h | ||
elf_priv.h | ||
elf.h | ||
file_cache.h | ||
frame_buffer_console.h | ||
generic_syscall.h | ||
heap.h | ||
int.h | ||
kdevice_manager.h | ||
kdriver_settings.h | ||
kernel_c++_structs.h | ||
kernel_daemon.h | ||
kernel.h | ||
kimage.h | ||
kmodule.h | ||
kscheduler.h | ||
ksignal.h | ||
ksyscalls.h | ||
ksystem_info.h | ||
listeners.h | ||
load_tracking.h | ||
lock.h | ||
low_resource_manager.h | ||
messaging.h | ||
MessagingServiceDefs.h | ||
Notifications.h | ||
port.h | ||
real_time_clock.h | ||
safemode.h | ||
scheduling_analysis.h | ||
sem.h | ||
smp.h | ||
syscall_restart.h | ||
system_profiler.h | ||
team.h | ||
thread_types.h | ||
thread.h | ||
timer.h | ||
tracing.h | ||
user_atomic.h | ||
user_debugger.h | ||
user_mutex.h | ||
UserEvent.h | ||
usergroup.h | ||
UserTimer.h | ||
vfs.h | ||
wait_for_objects.h |