boot: rework 32-bit/64-bit kernel load base selection

Change-Id: I0aed05c0ef2ff1a162581e4f988bf24ed1e521e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4816
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
This commit is contained in:
David Karoly
2021-12-27 15:44:56 +00:00
committed by Fredrik Holmqvist
parent b9a0a02382
commit 235aa994d7
8 changed files with 32 additions and 39 deletions
@@ -14,8 +14,7 @@
// memory layout
#define KERNEL_LOAD_BASE 0x80000000
#define KERNEL_LOAD_BASE_64_BIT 0xffffffc000000000
#define KERNEL_LOAD_BASE 0xffffffc000000000
#if (defined(__riscv) && __riscv_xlen == 64)
@@ -18,11 +18,15 @@
#ifdef _BOOT_MODE
// 32-bit and 64-bit kernel load addresses.
#ifdef _BOOT_PLATFORM_BIOS
#define KERNEL_LOAD_BASE_32_BIT 0x80000000
#define KERNEL_LOAD_BASE_64_BIT 0xffffffff80000000ll
#define KERNEL_FIXUP_FOR_LONG_MODE (KERNEL_LOAD_BASE_64_BIT - KERNEL_LOAD_BASE_32_BIT)
#elif __x86_64__
#define KERNEL_LOAD_BASE 0xffffffff80000000ll
#else
#define KERNEL_LOAD_BASE 0x80000000
#define KERNEL_LOAD_BASE_64_BIT 0xffffffff80000000ll
#endif
#elif defined(__x86_64__)