pmm: Make code to reserve page 0 uniform between BIOS and UEFI

This commit is contained in:
mintsuki 2022-09-01 04:58:18 +02:00
parent 4869c14ce0
commit fb372e6db7

View File

@ -167,7 +167,7 @@ static void sanitise_entries(struct memmap_entry *m, size_t *_count, bool align_
if (m[i].type != MEMMAP_USABLE)
continue;
if (bios && m[i].base < 0x1000) {
if (m[i].base < 0x1000) {
if (m[i].base + m[i].length <= 0x1000) {
goto del_mm1;
}
@ -230,8 +230,6 @@ struct memmap_entry *get_memmap(size_t *entries) {
pmm_reclaim_uefi_mem(memmap, &memmap_entries);
#endif
memmap_alloc_range(0, 0x1000, MEMMAP_RESERVED, MEMMAP_USABLE, false, false, false);
sanitise_entries(memmap, &memmap_entries, true);
*entries = memmap_entries;