pmm: Use untouched_memmap instead of memmap in pmm_release_uefi_mem

This commit is contained in:
mintsuki 2021-10-31 21:51:06 +01:00
parent 6f0d7228f1
commit f176e24376
2 changed files with 6 additions and 6 deletions

View File

@ -518,15 +518,13 @@ another_recl:;
void pmm_release_uefi_mem(void) {
EFI_STATUS status;
sanitise_entries(memmap, &memmap_entries, true);
for (size_t i = 0; i < memmap_entries; i++) {
if (memmap[i].type != MEMMAP_USABLE
&& memmap[i].type != MEMMAP_BOOTLOADER_RECLAIMABLE) {
for (size_t i = 0; i < untouched_memmap_entries; i++) {
if (untouched_memmap[i].type != MEMMAP_USABLE
&& untouched_memmap[i].type != MEMMAP_BOOTLOADER_RECLAIMABLE) {
continue;
}
status = gBS->FreePages(memmap[i].base, memmap[i].length / 4096);
status = gBS->FreePages(untouched_memmap[i].base, untouched_memmap[i].length / 4096);
if (status) {
panic("pmm: FreePages failure (%x)", status);

View File

@ -36,6 +36,8 @@ COMMENT=Contains legacy entries.
COMMENT=Stivale1 test.
KASLR=no
PROTOCOL=stivale
KERNEL_PATH=boot:///boot/test.elf
KERNEL_CMDLINE=Hi! This is an example!