summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-12-08 03:56:42 -0500
committerAmlal El Mahrouss <amlal@nekernel.org>2025-12-08 03:56:42 -0500
commite6768dc3b6c7864166211fd6e2f67ff4e5a2cbe5 (patch)
tree8fd8793369c30ddbfb61366407db3d464a95ad6b /src
parent1b82bb9468d38757b27d0723af26c2b052d92ce3 (diff)
chore: use `enum struct` instead of `enum class`.
chore: build scripts improvements. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/boot/src/HEL/AMD64/BootEFI.cc12
-rw-r--r--src/boot/src/HEL/ARM64/BootEFI.cc12
-rw-r--r--src/kernel/HALKit/AMD64/Paging.h2
-rw-r--r--src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc2
-rw-r--r--src/kernel/HALKit/ARM64/Paging.h2
-rw-r--r--src/kernel/KernelKit/CoreProcessScheduler.h8
-rw-r--r--src/kernel/KernelKit/PCI/DMA.h2
-rw-r--r--src/kernel/KernelKit/PCI/Database.h2
-rw-r--r--src/kernel/KernelKit/PCI/Device.h2
-rw-r--r--src/kernel/KernelKit/UserMgr.h2
-rw-r--r--src/kernel/NeKit/Config.h2
-rw-r--r--src/kernel/NeKit/Variant.h2
12 files changed, 25 insertions, 25 deletions
diff --git a/src/boot/src/HEL/AMD64/BootEFI.cc b/src/boot/src/HEL/AMD64/BootEFI.cc
index 7558ec62..c043bbb9 100644
--- a/src/boot/src/HEL/AMD64/BootEFI.cc
+++ b/src/boot/src/HEL/AMD64/BootEFI.cc
@@ -131,18 +131,18 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa
kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */
kHandoverHeader->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */
- UInt16 trials = 5;
+ UInt16 trials = 15;
while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize,
&kHandoverHeader->f_BitMapStart) != kEfiOk) {
--trials;
- if (!trials) {
- writer.Write("BootZ: Unable to allocate sufficient memory, trying again with 2GB...\r");
+ if (trials) {
+ writer.Write("BootZ: Unable to allocate sufficient memory, trying again...\r");
- trials = 3;
-
- kHandoverHeader->f_BitMapSize = kHandoverBitMapSz / 2; /* Size of bitmap in bytes. */
+ if (kHandoverHeader->f_BitMapSize > 0)
+ kHandoverHeader->f_BitMapSize =
+ kHandoverHeader->f_BitMapSize / 2; /* Size of bitmap in bytes. */
while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize,
&kHandoverHeader->f_BitMapStart) != kEfiOk) {
diff --git a/src/boot/src/HEL/ARM64/BootEFI.cc b/src/boot/src/HEL/ARM64/BootEFI.cc
index 7f4b152c..bdef6549 100644
--- a/src/boot/src/HEL/ARM64/BootEFI.cc
+++ b/src/boot/src/HEL/ARM64/BootEFI.cc
@@ -130,18 +130,18 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa
kHandoverHeader->f_BitMapStart = nullptr; /* Start of bitmap. */
kHandoverHeader->f_BitMapSize = kHandoverBitMapSz; /* Size of bitmap in bytes. */
- UInt16 trials = 5;
+ UInt16 trials = 15;
while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize,
&kHandoverHeader->f_BitMapStart) != kEfiOk) {
--trials;
- if (!trials) {
- writer.Write("BootZ: Unable to allocate sufficient memory, trying again with 2GB...\r");
+ if (trials) {
+ writer.Write("BootZ: Unable to allocate sufficient memory, trying again...\r");
- trials = 3;
-
- kHandoverHeader->f_BitMapSize = kHandoverBitMapSz / 2; /* Size of bitmap in bytes. */
+ if (kHandoverHeader->f_BitMapSize > 0)
+ kHandoverHeader->f_BitMapSize =
+ kHandoverHeader->f_BitMapSize / 2; /* Size of bitmap in bytes. */
while (BS->AllocatePool(EfiLoaderData, kHandoverHeader->f_BitMapSize,
&kHandoverHeader->f_BitMapStart) != kEfiOk) {
diff --git a/src/kernel/HALKit/AMD64/Paging.h b/src/kernel/HALKit/AMD64/Paging.h
index b8b276c0..77ea6f37 100644
--- a/src/kernel/HALKit/AMD64/Paging.h
+++ b/src/kernel/HALKit/AMD64/Paging.h
@@ -43,7 +43,7 @@ EXTERN_C Kernel::VoidPtr hal_read_cr3(); // @brief Page directory inside cr3 re
namespace Kernel::HAL {
namespace Detail {
- enum class ControlRegisterBits {
+ enum struct ControlRegisterBits {
kProtectedModeEnable = 0,
kMonitorCoProcessor = 1,
kEmulation = 2,
diff --git a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
index 51e73fca..d97884ff 100644
--- a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
+++ b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc
@@ -277,7 +277,7 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz
rtl_dma_flush(ptr, size_buffer);
if (kSATAHba->Is & kSATAErrTaskFile) {
- kout << "ahci: Task File Error during I/O.\r";
+ kout << "ahci: tf-error when doing I/O.\r";
rtl_dma_free(size_buffer);
err_global_get() = kErrorDiskIsCorrupted;
diff --git a/src/kernel/HALKit/ARM64/Paging.h b/src/kernel/HALKit/ARM64/Paging.h
index 28d31b60..34cf4213 100644
--- a/src/kernel/HALKit/ARM64/Paging.h
+++ b/src/kernel/HALKit/ARM64/Paging.h
@@ -68,7 +68,7 @@ struct PACKED PTE_4KB final {
};
namespace Detail {
- enum class ControlRegisterBits {
+ enum struct ControlRegisterBits {
ProtectedModeEnable = 0,
MonitorCoProcessor = 1,
Emulation = 2,
diff --git a/src/kernel/KernelKit/CoreProcessScheduler.h b/src/kernel/KernelKit/CoreProcessScheduler.h
index 7a53f94c..da89b112 100644
--- a/src/kernel/KernelKit/CoreProcessScheduler.h
+++ b/src/kernel/KernelKit/CoreProcessScheduler.h
@@ -142,7 +142,7 @@ struct PROCESS_SPECIAL_TREE {
/// @brief Subsystem enum type.
/***********************************************************************************/
-enum class ProcessSubsystem : Int32 {
+enum struct ProcessSubsystem : Int32 {
kProcessSubsystemSecurity = 100,
kProcessSubsystemUser,
kProcessSubsystemService,
@@ -155,7 +155,7 @@ enum class ProcessSubsystem : Int32 {
/***********************************************************************************/
//! @brief Local Process status enum.
/***********************************************************************************/
-enum class ProcessStatusKind : Int32 {
+enum struct ProcessStatusKind : Int32 {
kInvalid = 0,
kStarting = 100,
kRunning,
@@ -168,7 +168,7 @@ enum class ProcessStatusKind : Int32 {
/***********************************************************************************/
//! @brief Affinity is the amount of nano-seconds this process is going to run.
/***********************************************************************************/
-enum class AffinityKind : Int32 {
+enum struct AffinityKind : Int32 {
kInvalid = 0,
kRealTime = 100,
kVeryHigh = 150,
@@ -221,7 +221,7 @@ using ProcessID = Int64;
/***********************************************************************************/
/// @note For User manager, tells where we run the code.
/***********************************************************************************/
-enum class ProcessLevelRing : Int32 {
+enum struct ProcessLevelRing : Int32 {
kRingStdUser = 1,
kRingSuperUser = 2,
kRingGuestUser = 5,
diff --git a/src/kernel/KernelKit/PCI/DMA.h b/src/kernel/KernelKit/PCI/DMA.h
index 0cc642c1..d965a3c9 100644
--- a/src/kernel/KernelKit/PCI/DMA.h
+++ b/src/kernel/KernelKit/PCI/DMA.h
@@ -13,7 +13,7 @@
#include <NeKit/Ref.h>
namespace Kernel {
-enum class DmaKind {
+enum struct DmaKind {
PCI = 10, // Bus mastering is required to be turned on. Basiaclly a request
// control system. 64-Bit access depends on the PAE bit and the device
// (if Double Address Cycle is available)
diff --git a/src/kernel/KernelKit/PCI/Database.h b/src/kernel/KernelKit/PCI/Database.h
index 73013c74..35740fdc 100644
--- a/src/kernel/KernelKit/PCI/Database.h
+++ b/src/kernel/KernelKit/PCI/Database.h
@@ -11,7 +11,7 @@
namespace Kernel {
namespace Types {
// https://wiki.osdev.org/PCI
- enum class PciDeviceKind : UChar {
+ enum struct PciDeviceKind : UChar {
MassStorageController = 0x1,
NetworkController = 0x2,
DisplayController = 0x3,
diff --git a/src/kernel/KernelKit/PCI/Device.h b/src/kernel/KernelKit/PCI/Device.h
index e9c5a683..3e7284de 100644
--- a/src/kernel/KernelKit/PCI/Device.h
+++ b/src/kernel/KernelKit/PCI/Device.h
@@ -10,7 +10,7 @@
#include <NeKit/KernelPanic.h>
namespace Kernel::PCI {
-enum class PciConfigKind : UShort {
+enum struct PciConfigKind : UShort {
ConfigAddress = 0xCF8,
ConfigData = 0xCFC,
CommandReg = 0x0004,
diff --git a/src/kernel/KernelKit/UserMgr.h b/src/kernel/KernelKit/UserMgr.h
index 3f36f240..3b48f686 100644
--- a/src/kernel/KernelKit/UserMgr.h
+++ b/src/kernel/KernelKit/UserMgr.h
@@ -34,7 +34,7 @@
namespace Kernel {
class User;
-enum class UserRingKind : Int32 {
+enum struct UserRingKind : Int32 {
kRingInvalid = 0,
kRingStdUser = 444,
kRingSuperUser = 666,
diff --git a/src/kernel/NeKit/Config.h b/src/kernel/NeKit/Config.h
index 071018eb..f8414069 100644
--- a/src/kernel/NeKit/Config.h
+++ b/src/kernel/NeKit/Config.h
@@ -79,7 +79,7 @@ using Lba = UInt64;
using Char16 = char16_t;
-enum class Endian : UInt8 { kEndianInvalid, kEndianBig, kEndianLittle, kEndianMixed, kEndianCount };
+enum struct Endian : UInt8 { kEndianInvalid, kEndianBig, kEndianLittle, kEndianMixed, kEndianCount };
/// @brief Forward object.
/// @tparam Args the object type.
diff --git a/src/kernel/NeKit/Variant.h b/src/kernel/NeKit/Variant.h
index a7257805..bf2b53c4 100644
--- a/src/kernel/NeKit/Variant.h
+++ b/src/kernel/NeKit/Variant.h
@@ -15,7 +15,7 @@
namespace Kernel {
class Variant final {
public:
- enum class VariantKind {
+ enum struct VariantKind {
kInvalid = 0,
kString = 200,
kBlob,