From f83e7bddcf24433adbfc9214e0f8f8139f8b6362 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 1 Dec 2024 18:41:41 +0100 Subject: FIX: Fixing ARM64 execution when booting from bootloader. FIX: Now works both for ARM64 and AMD64 EFI backends. TODO: The ACB backend needs to be done too. Signed-off-by: Amlal El Mahrouss --- dev/ZBAKit/BootKit/Support.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'dev/ZBAKit/BootKit') diff --git a/dev/ZBAKit/BootKit/Support.h b/dev/ZBAKit/BootKit/Support.h index 1ee1dc47..2c1db6f4 100644 --- a/dev/ZBAKit/BootKit/Support.h +++ b/dev/ZBAKit/BootKit/Support.h @@ -6,13 +6,11 @@ #pragma once -#include - /// @file Support.h /// @brief Purpose of this file is to help port libs into the bootloader. -#define cLongMax ((long)(~0UL >> 1)) -#define cLongMin (~cLongMax) +#define kLongMax ((long)(~0UL >> 1)) +#define kLongMin (~kLongMax) #ifdef __NEWOSLDR__ @@ -65,7 +63,7 @@ inline long StringToLong(const char* nptr, char** endptr, int base) const char *p = nptr, *endp; bool is_neg = 0, overflow = 0; - /* Need unsigned so (-cLongMin) can fit in these: */ + /* Need unsigned so (-kLongMin) can fit in these: */ unsigned long n = 0UL, cutoff; int cutlim; @@ -124,8 +122,8 @@ inline long StringToLong(const char* nptr, char** endptr, int base) base = 10; } - cutoff = (is_neg) ? -(cLongMin / base) : cLongMax / base; - cutlim = (is_neg) ? -(cLongMin % base) : cLongMax % base; + cutoff = (is_neg) ? -(kLongMin / base) : kLongMax / base; + cutlim = (is_neg) ? -(kLongMin % base) : kLongMax % base; while (1) { @@ -160,7 +158,7 @@ inline long StringToLong(const char* nptr, char** endptr, int base) if (overflow) { - return ((is_neg) ? cLongMin : cLongMax); + return ((is_neg) ? kLongMin : kLongMax); } return (long)((is_neg) ? -n : n); -- cgit v1.2.3