From 957f468cc1097ed92eef7915eea891fcb016dc00 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 21 Feb 2020 09:34:50 -0600 Subject: [PATCH] efi/mmu: ensure sNextVirtualAddress is valid on 32-bit platforms Change-Id: I1c762410860ac7a27cfc78345de3226e36195aba Reviewed-on: https://review.haiku-os.org/c/haiku/+/2258 Reviewed-by: Adrien Destugues --- src/system/boot/platform/efi/mmu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/system/boot/platform/efi/mmu.cpp b/src/system/boot/platform/efi/mmu.cpp index 037a73d206..75fcd1060b 100644 --- a/src/system/boot/platform/efi/mmu.cpp +++ b/src/system/boot/platform/efi/mmu.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "efi_platform.h" @@ -27,7 +26,15 @@ struct allocated_memory_region { }; +#if defined(KERNEL_LOAD_BASE_64_BIT) static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE_64_BIT + 32 * 1024 * 1024; +#elif defined(KERNEL_LOAD_BASE) +static addr_t sNextVirtualAddress = KERNEL_LOAD_BASE + 32 * 1024 * 1024; +#else +#error Unable to find kernel load base on this architecture! +#endif + + static allocated_memory_region *allocated_memory_regions = NULL;