bootloader: Actually ignore memory from ranges partially beyond 4GB.

It was added to ignored_physical_memory but not actually trimmed.
This commit is contained in:
Augustin Cavalier 2024-10-18 17:53:14 -04:00
parent a0e3665350
commit 6e8900976d

View File

@ -368,13 +368,14 @@ ignore_physical_memory_ranges_beyond_4gb()
continue;
}
if (kLimit - range.start < range.size) {
if ((range.start + range.size) >= kLimit) {
// the range is partially beyond the limit
dprintf("ignore_physical_memory_ranges_beyond_4gb(): ignoring "
"range: %#" B_PRIx64 " - %#" B_PRIx64 "\n", kLimit,
range.start + range.size);
gKernelArgs.ignored_physical_memory
+= range.size - (kLimit - range.start);
range.size = kLimit - range.start;
}
break;