summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-01 12:50:24 +0200
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-05-01 12:50:24 +0200
commit91fbaf05d24a89c3c77a8cbe7a26e27615b85e88 (patch)
tree50ca16b00208824c14628ea5650d6476583a92dc
parentbf1629df18bbbbdb056f676d6c0b8c3a8119a8a2 (diff)
Fix bootloader include order.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
-rw-r--r--Private/FirmwareKit/EFI.hxx1
-rw-r--r--Private/FirmwareKit/EFI/API.hxx2
-rw-r--r--Private/KernelKit/Framebuffer.hpp7
-rw-r--r--Private/NewBoot/BootKit/BootKit.hxx4
-rw-r--r--Private/NewBoot/BootKit/Vendor/Qr.hxx3
-rw-r--r--Private/NewBoot/BootKit/Vendor/Support.hxx12
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx1
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootMain.cxx1
-rw-r--r--Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx1
-rw-r--r--Private/NewKit/Macros.hpp4
10 files changed, 17 insertions, 19 deletions
diff --git a/Private/FirmwareKit/EFI.hxx b/Private/FirmwareKit/EFI.hxx
index 14c8c709..5df9926d 100644
--- a/Private/FirmwareKit/EFI.hxx
+++ b/Private/FirmwareKit/EFI.hxx
@@ -4,5 +4,4 @@
------------------------------------------- */
-#include <FirmwareKit/EFI/API.hxx>
#include <FirmwareKit/EFI/EFI.hxx>
diff --git a/Private/FirmwareKit/EFI/API.hxx b/Private/FirmwareKit/EFI/API.hxx
index b17e7afd..ce1ab975 100644
--- a/Private/FirmwareKit/EFI/API.hxx
+++ b/Private/FirmwareKit/EFI/API.hxx
@@ -92,7 +92,7 @@ inline void ThrowError(const EfiCharType *ErrorCode,
constexpr auto ver = 4;
auto ecc = qr::Ecc::H;
auto str = "https://el-mahrouss-logic.com/";
- auto len = BStrLen(L"https://el-mahrouss-logic.com/");
+ auto len = StrLen("https://el-mahrouss-logic.com/");
qr::Qr<ver> encoder;
qr::QrDelegate encoderDelegate;
diff --git a/Private/KernelKit/Framebuffer.hpp b/Private/KernelKit/Framebuffer.hpp
index 555aad2d..ada00447 100644
--- a/Private/KernelKit/Framebuffer.hpp
+++ b/Private/KernelKit/Framebuffer.hpp
@@ -80,11 +80,4 @@ extern const UInt32 kRgbBlack;
extern const UInt32 kRgbWhite;
} // namespace NewOS
-/***********************************************************************************/
-/// Color macros.
-/***********************************************************************************/
-
-/// @brief Macro hack to make a color (as hexadecimal)
-#define RGB(R, G, B) (NewOS::UInt32)(0x##R##G##B)
-
#endif /* ifndef __INC_FB_HPP__ */
diff --git a/Private/NewBoot/BootKit/BootKit.hxx b/Private/NewBoot/BootKit/BootKit.hxx
index 03dddcb3..c8333b86 100644
--- a/Private/NewBoot/BootKit/BootKit.hxx
+++ b/Private/NewBoot/BootKit/BootKit.hxx
@@ -27,12 +27,12 @@
#include <NewKit/Defines.hpp>
#include <Builtins/ATA/ATA.hxx>
+#include <FirmwareKit/EFI.hxx>
+
/***********************************************************************************/
/// Framebuffer helpers.
/***********************************************************************************/
-#define RGB(R, G, B) (UInt32)(0x##R##G##B)
-
class BTextWriter;
class BFileReader;
class BFileRunner;
diff --git a/Private/NewBoot/BootKit/Vendor/Qr.hxx b/Private/NewBoot/BootKit/Vendor/Qr.hxx
index 27db8060..982af6b5 100644
--- a/Private/NewBoot/BootKit/Vendor/Qr.hxx
+++ b/Private/NewBoot/BootKit/Vendor/Qr.hxx
@@ -9,9 +9,8 @@
#include <BootKit/Vendor/QrVendor/bit.h>
#include <BootKit/Vendor/QrPrelude.hxx>
-#include <BootKit/Vendor/Support.hxx>
#include <Builtins/Toolbox/Toolbox.hxx>
-#include <cstdint>
+#include <BootKit/Vendor/Support.hxx>
#include <CompilerKit/Detail.hxx>
namespace qr {
diff --git a/Private/NewBoot/BootKit/Vendor/Support.hxx b/Private/NewBoot/BootKit/Vendor/Support.hxx
index fe3d35c3..88483984 100644
--- a/Private/NewBoot/BootKit/Vendor/Support.hxx
+++ b/Private/NewBoot/BootKit/Vendor/Support.hxx
@@ -10,8 +10,8 @@
#include <BootKit/BootKit.hxx>
-#define LONG_MAX ((long)(~0UL>>1))
-#define LONG_MIN (~LONG_MAX)
+#define cLongMax ((long)(~0UL>>1))
+#define cLongMin (~cLongMax)
#define SetMem(dst, c, sz) memset(dst, c, sz)
#define MoveMem(dst, src, sz) memcpy(dst, src, sz)
@@ -23,7 +23,7 @@ inline int isspace(int c) { return c == ' '; }
inline long StringToLong(const char * nptr, char ** endptr, int base) {
const char *p = nptr, *endp;
bool is_neg = 0, overflow = 0;
- /* Need unsigned so (-LONG_MIN) can fit in these: */
+ /* Need unsigned so (-cLongMin) can fit in these: */
unsigned long n = 0UL, cutoff;
int cutlim;
if (base < 0 || base == 1 || base > 36) {
@@ -60,8 +60,8 @@ inline long StringToLong(const char * nptr, char ** endptr, int base) {
} else if (base == 0) {
base = 10;
}
- cutoff = (is_neg) ? -(LONG_MIN / base) : LONG_MAX / base;
- cutlim = (is_neg) ? -(LONG_MIN % base) : LONG_MAX % base;
+ cutoff = (is_neg) ? -(cLongMin / base) : cLongMax / base;
+ cutlim = (is_neg) ? -(cLongMin % base) : cLongMax % base;
while (1) {
int c;
if (*p >= 'A')
@@ -85,7 +85,7 @@ inline long StringToLong(const char * nptr, char ** endptr, int base) {
}
if (endptr) *endptr = (char *)endp;
if (overflow) {
- return ((is_neg) ? LONG_MIN : LONG_MAX);
+ return ((is_neg) ? cLongMin : cLongMax);
}
return (long)((is_neg) ? -n : n);
}
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx b/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
index e01d0b96..0f711334 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootFileReader.cxx
@@ -12,6 +12,7 @@
#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
#include <FirmwareKit/Handover.hxx>
+#include <FirmwareKit/EFI/API.hxx>
#include <cstddef>
/// @file BootFileReader
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
index 0cbeadfa..e0e37b7d 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootMain.cxx
@@ -4,6 +4,7 @@
------------------------------------------- */
+#include <FirmwareKit/EFI/API.hxx>
#include <BootKit/Rsrc/NewBoot.rsrc>
#include <Builtins/Toolbox/Toolbox.hxx>
#include <FirmwareKit/EFI.hxx>
diff --git a/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx b/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx
index 2a92ce6d..13ef35c8 100644
--- a/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx
+++ b/Private/NewBoot/Source/HEL/AMD64/BootTextWriter.cxx
@@ -11,6 +11,7 @@
------------------------------------------- */
+#include <FirmwareKit/EFI/API.hxx>
#include <BootKit/Platform.hxx>
#include <BootKit/Protocol.hxx>
#include <BootKit/BootKit.hxx>
diff --git a/Private/NewKit/Macros.hpp b/Private/NewKit/Macros.hpp
index c1d5547b..f2094c87 100644
--- a/Private/NewKit/Macros.hpp
+++ b/Private/NewKit/Macros.hpp
@@ -92,3 +92,7 @@
#define STRINGIFY(X) #X
#define NEWOS_UNUSED(X) ((void)X)
+
+#ifndef RGB
+#define RGB(R, G, B) (UInt32)(0x##R##G##B)
+#endif // !RGB