From 45b39285f12fa8232ba0870415563922d7638894 Mon Sep 17 00:00:00 2001 From: 48cf <32851089+48cf@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:43:13 +0200 Subject: [PATCH] pmm: Ignore allow_high_allocs on non x86-64 architectures --- common/mm/pmm.s2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/mm/pmm.s2.c b/common/mm/pmm.s2.c index 41267094..a5dbd514 100644 --- a/common/mm/pmm.s2.c +++ b/common/mm/pmm.s2.c @@ -573,7 +573,7 @@ void *ext_mem_alloc_type_aligned(size_t count, uint32_t type, size_t alignment) // Allocate memory top down. void *ext_mem_alloc_type_aligned_mode(size_t count, uint32_t type, size_t alignment, bool allow_high_allocs) { -#if !defined (__x86_64__) && !defined (__aarch64__) && !defined (__riscv64) +#if !defined (__x86_64__) (void)allow_high_allocs; #endif @@ -589,9 +589,10 @@ void *ext_mem_alloc_type_aligned_mode(size_t count, uint32_t type, size_t alignm int64_t entry_base = (int64_t)(memmap[i].base); int64_t entry_top = (int64_t)(memmap[i].base + memmap[i].length); +#if defined(__x86_64__) || defined(__i386__) // Let's make sure the entry is not > 4GiB if (entry_top >= 0x100000000 -#if defined (__x86_64__) || defined (__aarch64__) || defined (__riscv64) +#if defined (__x86_64__) && !allow_high_allocs #endif ) { @@ -599,6 +600,7 @@ void *ext_mem_alloc_type_aligned_mode(size_t count, uint32_t type, size_t alignm if (entry_base >= entry_top) continue; } +#endif int64_t alloc_base = ALIGN_DOWN(entry_top - (int64_t)count, alignment);