From 79781941e798ab54588a4e12ae247cabc699e481 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Mon, 28 Feb 2022 08:24:44 +0100 Subject: [PATCH] pmm: Fix alignment issue introduced in 3fe8217 --- common/mm/pmm.s2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/mm/pmm.s2.c b/common/mm/pmm.s2.c index d5e244d5..2b6e5dbb 100644 --- a/common/mm/pmm.s2.c +++ b/common/mm/pmm.s2.c @@ -385,8 +385,10 @@ void init_memmap(void) { memcpy(untouched_memmap, memmap, memmap_entries * sizeof(struct e820_entry_t)); untouched_memmap_entries = memmap_entries; + size_t bootloader_size = ALIGN_UP((uintptr_t)_edata - (uintptr_t)ImageBase, 4096); + // Allocate bootloader itself - memmap_alloc_range((uintptr_t)ImageBase, (uintptr_t)_edata - (uintptr_t)ImageBase, + memmap_alloc_range((uintptr_t)ImageBase, bootloader_size, MEMMAP_BOOTLOADER_RECLAIMABLE, false, true, false, true); sanitise_entries(memmap, &memmap_entries, false);