diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-30 08:10:48 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2026-01-30 08:10:48 +0100 |
| commit | 72b41e2f711198ad9baa846e7ba37f6e070cedb0 (patch) | |
| tree | 412e384fb7ad218098d69c52d5d92a2801ec8a8e /src/kernel | |
| parent | 951e967388dbf628e9a4b8b6ce4e8a637de91d75 (diff) | |
chore: ddk: Fix build on nebuild for C++ DDK.
chore: kernel: Tweaks and internal improvements.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel')
42 files changed, 306 insertions, 233 deletions
diff --git a/src/kernel/FSKit/Ext2+IFS.h b/src/kernel/FSKit/Ext2+IFS.h index 242db5f9..edefc978 100644 --- a/src/kernel/FSKit/Ext2+IFS.h +++ b/src/kernel/FSKit/Ext2+IFS.h @@ -31,7 +31,7 @@ class Ext2Context final { } } - Ext2Context(const Ext2Context&) = delete; + Ext2Context(const Ext2Context&) = delete; Ext2Context& operator=(const Ext2Context&) = delete; Ext2Context(Ext2Context&& other) : drive(other.drive), superblock(other.superblock) { diff --git a/src/kernel/FSKit/OpenHeFS.h b/src/kernel/FSKit/OpenHeFS.h index 7b4da7c5..da74f6bb 100644 --- a/src/kernel/FSKit/OpenHeFS.h +++ b/src/kernel/FSKit/OpenHeFS.h @@ -7,7 +7,7 @@ #include <CompilerKit/CompilerKit.h> #include <KernelKit/DriveMgr.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/Config.h> #include <NeKit/Crc32.h> #include <NeKit/KString.h> @@ -266,7 +266,7 @@ inline UInt32 hefs_hour_get(ATime raw_atime) { /// @return the minute value. /// @note The minute is stored in the lower 8 bits of the ATime value. inline UInt32 hefs_minute_get(ATime raw_atime) { - return (raw_atime) & 0xFF; + return (raw_atime) &0xFF; } inline constexpr UInt32 kOpenHeFSBaseYear = 1970; @@ -386,10 +386,10 @@ class HeFileSystemParser final { ~HeFileSystemParser() = default; public: - HeFileSystemParser(const HeFileSystemParser&) = delete; + HeFileSystemParser(const HeFileSystemParser&) = delete; HeFileSystemParser& operator=(const HeFileSystemParser&) = delete; - HeFileSystemParser(HeFileSystemParser&&) = delete; + HeFileSystemParser(HeFileSystemParser&&) = delete; HeFileSystemParser& operator=(HeFileSystemParser&&) = delete; public: diff --git a/src/kernel/FirmwareKit/EFI/EFI.h b/src/kernel/FirmwareKit/EFI/EFI.h index 912be6eb..2418f20c 100644 --- a/src/kernel/FirmwareKit/EFI/EFI.h +++ b/src/kernel/FirmwareKit/EFI/EFI.h @@ -55,7 +55,7 @@ typedef Char16 EfiChar16Type; /// @brief Core Handle Kind /// Self is like NT's Win32 HANDLE type. typedef struct EfiHandle { -}* EfiHandlePtr; +} * EfiHandlePtr; /* UEFI uses wide characters by default. */ typedef WideChar EfiCharType; @@ -237,42 +237,64 @@ typedef struct EfiTableHeader { UInt32 Reserved; } EfiTableHeader; -#define EFI_ACPI_TABLE_PROTOCOL_GUID \ - {0xffe06bdd, 0x6107, 0x46a6, {0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c}} +#define EFI_ACPI_TABLE_PROTOCOL_GUID \ + { \ + 0xffe06bdd, 0x6107, 0x46a6, { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c } \ + } -#define EFI_LOAD_FILE_PROTOCOL_GUID \ - {0x56EC3091, 0x954C, 0x11d2, {0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}} +#define EFI_LOAD_FILE_PROTOCOL_GUID \ + { \ + 0x56EC3091, 0x954C, 0x11d2, { 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } -#define EFI_LOAD_FILE2_PROTOCOL_GUID \ - {0x4006c0c1, 0xfcb3, 0x403e, {0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d}} +#define EFI_LOAD_FILE2_PROTOCOL_GUID \ + { \ + 0x4006c0c1, 0xfcb3, 0x403e, { 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d } \ + } -#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ - {0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B}} +#define EFI_LOADED_IMAGE_PROTOCOL_GUID \ + { \ + 0x5B1B31A1, 0x9562, 0x11d2, { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \ + } -#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ - {0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a}} +#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \ + { \ + 0x9042a9de, 0x23dc, 0x4a38, { 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \ + } -#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \ - {0xA19832B9, 0xAC25, 0x11D3, {0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d}} +#define EFI_SIMPLE_NETWORK_PROTOCOL_GUID \ + { \ + 0xA19832B9, 0xAC25, 0x11D3, { 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } #define EFI_SIMPLE_NETWORK_PROTOCOL_REVISION 0x00010000 -#define EFI_IP4_PROTOCOL_GUID \ - {0x41d94cd2, 0x35b6, 0x455a, {0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd}} +#define EFI_IP4_PROTOCOL_GUID \ + { \ + 0x41d94cd2, 0x35b6, 0x455a, { 0x82, 0x58, 0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd } \ + } #define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000 -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - {0x0964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}} +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { \ + 0x0964e5b22, 0x6459, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } -#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ - {0xbc62157e, 0x3e33, 0x4fec, {0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf}} +#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \ + { \ + 0xbc62157e, 0x3e33, 0x4fec, { 0x99, 0x20, 0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf } \ + } -#define EFI_DEVICE_PATH_PROTOCOL_GUID \ - {0x9576e91, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b}} +#define EFI_DEVICE_PATH_PROTOCOL_GUID \ + { \ + 0x9576e91, 0x6d3f, 0x11d2, { 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } -#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ - {0x0964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}} +#define EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \ + { \ + 0x0964e5b22, 0x6459, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } typedef UInt64(EfiImageUnload)(EfiHandlePtr ImageHandle); @@ -327,17 +349,17 @@ typedef struct { typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_TRANSMIT)(IN EFI_SIMPLE_NETWORK_PROTOCOL* This, IN UInt32 HeaderSize, IN UInt32 BufferSize, - IN Void* Buffer, - IN EfiMacAddress* SrcAddr OPTIONAL, + IN Void* Buffer, + IN EfiMacAddress* SrcAddr OPTIONAL, IN EfiMacAddress* DestAddr OPTIONAL, - IN UInt16* Protocol OPTIONAL); + IN UInt16* Protocol OPTIONAL); typedef EFI_STATUS(EFIAPI* EFI_SIMPLE_NETWORK_RECEIVE)(IN EFI_SIMPLE_NETWORK_PROTOCOL* This, - OUT UInt32* HeaderSize OPTIONAL, + OUT UInt32* HeaderSize OPTIONAL, IN OUT UInt32* BufferSize, OUT Void* Buffer, - OUT EfiMacAddress* SrcAddr OPTIONAL, + OUT EfiMacAddress* SrcAddr OPTIONAL, OUT EfiMacAddress* DestAddr OPTIONAL, - OUT UInt16* Protocol OPTIONAL); + OUT UInt16* Protocol OPTIONAL); typedef struct EFI_SIMPLE_NETWORK_PROTOCOL { UInt64 Revision; @@ -482,8 +504,10 @@ typedef struct EFI_GUID EFI_FINAL { * Protocol stuff... */ -#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ - {0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}} +#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ + { \ + 0x387477c1, 0x69c7, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } /** some helpers */ #define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 @@ -581,7 +605,7 @@ typedef struct { } EfiInputKey; typedef EfiStatusType(EFI_API* EfiInputReadKey)(IN EfiSimpleTextInputProtocol* This, - OUT EfiInputKey* Key); + OUT EfiInputKey* Key); typedef EfiStatusType(EFI_API* EfiInputReset)(IN EfiSimpleTextInputProtocol* This, IN Boolean ExtendedChk); @@ -639,7 +663,7 @@ typedef struct EfiSystemTable { struct { EFI_GUID VendorGUID; VoidPtr VendorTable; - }* ConfigurationTable; + } * ConfigurationTable; } EfiSystemTable; #define kEfiOk 0 @@ -700,8 +724,10 @@ enum { #define EFI_EXTRA_DESCRIPTOR_SIZE 8 -#define EFI_MP_SERVICES_PROTOCOL_GUID \ - {0x3fdda605, 0xa76e, 0x4f46, {0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08}} +#define EFI_MP_SERVICES_PROTOCOL_GUID \ + { \ + 0x3fdda605, 0xa76e, 0x4f46, { 0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08 } \ + } #define PROCESSOR_AS_BSP_BIT 0x00000001 #define PROCESSOR_ENABLED_BIT 0x00000002 @@ -797,8 +823,10 @@ typedef struct EfiTime { UInt8 Pad2; } EfiTime; -#define EFI_FILE_INFO_GUID \ - {0x09576e92, 0x6d3f, 0x11d2, {0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b}} +#define EFI_FILE_INFO_GUID \ + { \ + 0x09576e92, 0x6d3f, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ + } struct EfiFileInfo EFI_FINAL { /// @brief Structure size. @@ -866,8 +894,8 @@ typedef EfiStatusType EFI_API (*EfiMpServicesStartupThisAP)( IN Void* ProcedureArgument OPTIONAL, OUT Boolean* Finished OPTIONAL); typedef EfiStatusType EFI_API (*EfiMpServicesDisableThisAP)(IN struct _EfiMpServicesProtocol* Self, - IN UInt32 ProcessorNumber, - IN Boolean EnableAP, + IN UInt32 ProcessorNumber, + IN Boolean EnableAP, IN UInt32* HealthFlag OPTIONAL); typedef EfiStatusType EFI_API (*EfiMpServicesWhoAmI)(IN struct _EfiMpServicesProtocol* Self, diff --git a/src/kernel/GfxKit/GPU.h b/src/kernel/GfxKit/GPU.h index af99e8b2..1e4198f0 100644 --- a/src/kernel/GfxKit/GPU.h +++ b/src/kernel/GfxKit/GPU.h @@ -11,6 +11,11 @@ namespace Kernel { class GPUDeviceInterface; +using GPUCoord2x2 = UInt32; +using GPUDim2x2 = UInt32; +using GPUColorProfile = UInt32; +using GPUFlags = UInt32; + /// @brief Framebuffer device interface. /// @details This class is used to send and receive data from the framebuffer device. /// @note The class is derived from the IDevice class. diff --git a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc index 34c2c6a0..2c8a5e28 100644 --- a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc +++ b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc @@ -4,7 +4,7 @@ #include <ArchKit/ArchKit.h> #include <KernelKit/ProcessScheduler.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/Atom.h> #include <NeKit/KString.h> #include <SignalKit/Signals.h> @@ -65,7 +65,8 @@ EXTERN_C void idt_handle_scheduler(Kernel::UIntPtr rsp) { hal_idt_send_eoi(32); - while (kIsRunning); + while (kIsRunning) + ; kIsRunning = YES; diff --git a/src/kernel/HALKit/AMD64/HalKernelMain.cc b/src/kernel/HALKit/AMD64/HalKernelMain.cc index 0179732f..cdf593cb 100644 --- a/src/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/src/kernel/HALKit/AMD64/HalKernelMain.cc @@ -157,6 +157,7 @@ EXTERN_C Kernel::Void hal_real_init(Kernel::Void) { HAL::IDTLoader idt_loader; idt_loader.Load(idt_reg); - while (YES); + while (YES) + ; } #endif // ifndef __NE_MODULAR_KERNEL_COMPONENTS__ diff --git a/src/kernel/HALKit/AMD64/Paging.h b/src/kernel/HALKit/AMD64/Paging.h index 41543f5d..96f87973 100644 --- a/src/kernel/HALKit/AMD64/Paging.h +++ b/src/kernel/HALKit/AMD64/Paging.h @@ -56,9 +56,7 @@ namespace Detail { kPageEnable = 31, }; - inline UInt8 control_register_cast(ControlRegisterBits reg) { - return static_cast<UInt8>(reg); - } + inline UInt8 control_register_cast(ControlRegisterBits reg) { return static_cast<UInt8>(reg); } } // namespace Detail auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page, SizeT pad = 0) -> VoidPtr; diff --git a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 456b6a2a..c4fdf56f 100644 --- a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -281,7 +281,8 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz goto ahci_io_end; } else { kout << "ahci: Disk still busy after command completion!\r"; - while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)); + while (kSATAHba->Ports[kSATAIndex].Tfd & (kSATASRBsy | kSATASRDrq)) + ; } ahci_io_end: @@ -294,15 +295,13 @@ STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz @brief Gets the number of sectors inside the drive. @return Sector size in bytes. */ -STATIC ATTRIBUTE(unused) -SizeT drv_get_sector_count_ahci() { +STATIC ATTRIBUTE(unused) SizeT drv_get_sector_count_ahci() { return kSATASectorCount; } /// @brief Get the drive size. /// @return Disk size in bytes. -STATIC ATTRIBUTE(unused) -SizeT drv_get_size_ahci() { +STATIC ATTRIBUTE(unused) SizeT drv_get_size_ahci() { return drv_std_get_sector_count() * kAHCISectorSize; } diff --git a/src/kernel/HALKit/AMD64/Storage/DMA+Generic.cc b/src/kernel/HALKit/AMD64/Storage/DMA+Generic.cc index 8bf7b161..a258bf3a 100644 --- a/src/kernel/HALKit/AMD64/Storage/DMA+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/DMA+Generic.cc @@ -92,7 +92,7 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz - 1) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); @@ -110,7 +110,8 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz rt_out8(kATADevice.Bar(0x20) + 0x00, 0x09); // Start DMA engine - while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01); + while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) + ; rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine @@ -133,7 +134,7 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + (SectorSz - 1)) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); @@ -149,7 +150,8 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS rt_out8(IO + 0x00, 0x09); // Start DMA engine - while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01); + while (rt_in8(kATADevice.Bar(0x20) + ATA_REG_STATUS) & 0x01) + ; rt_out8(kATADevice.Bar(0x20) + 0x00, 0x00); // Stop DMA engine diff --git a/src/kernel/HALKit/AMD64/Storage/PIO+Generic.cc b/src/kernel/HALKit/AMD64/Storage/PIO+Generic.cc index 19497b5f..6f5ebb66 100644 --- a/src/kernel/HALKit/AMD64/Storage/PIO+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/PIO+Generic.cc @@ -70,7 +70,8 @@ ATAInit_Retry: rt_out8(OutBus + ATA_REG_COMMAND, ATA_CMD_IDENTIFY); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; /// fetch serial info /// model, speed, number of sectors... @@ -103,14 +104,15 @@ Void drv_pio_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT Sect rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_READ_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { drv_pio_std_wait_io(IO); @@ -134,14 +136,15 @@ Void drv_pio_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT Sec rt_out8(IO + ATA_REG_SEC_COUNT0, ((Size + SectorSz) / SectorSz)); - rt_out8(IO + ATA_REG_LBA0, (Lba) & 0xFF); + rt_out8(IO + ATA_REG_LBA0, (Lba) &0xFF); rt_out8(IO + ATA_REG_LBA1, (Lba) >> 8); rt_out8(IO + ATA_REG_LBA2, (Lba) >> 16); rt_out8(IO + ATA_REG_LBA3, (Lba) >> 24); rt_out8(IO + ATA_REG_COMMAND, ATA_CMD_WRITE_PIO); - while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)); + while (!(rt_in8(IO + ATA_REG_STATUS) & ATA_SR_DRQ)) + ; for (SizeT IndexOff = 0; IndexOff < Size; IndexOff += 2) { drv_pio_std_wait_io(IO); diff --git a/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc b/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc index 7ee4a69c..31a083d3 100644 --- a/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc +++ b/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc @@ -4,7 +4,7 @@ #include <ArchKit/ArchKit.h> #include <KernelKit/ProcessScheduler.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/KString.h> #include <SignalKit/Signals.h> @@ -54,7 +54,8 @@ EXTERN_C void int_handle_scheduler(Kernel::UIntPtr rsp) { hal_int_send_eoi(32); - while (kIsRunning); + while (kIsRunning) + ; kIsRunning = YES; diff --git a/src/kernel/HALKit/ARM64/HalKernelMain.cc b/src/kernel/HALKit/ARM64/HalKernelMain.cc index 3a6e4085..9d2b21d7 100644 --- a/src/kernel/HALKit/ARM64/HalKernelMain.cc +++ b/src/kernel/HALKit/ARM64/HalKernelMain.cc @@ -55,6 +55,7 @@ EXTERN_C void hal_init_platform(Kernel::HEL::BootInfoHeader* handover_hdr) { Kernel::mp_init_cores(); - while (YES); + while (YES) + ; } #endif diff --git a/src/kernel/HALKit/ARM64/Paging.h b/src/kernel/HALKit/ARM64/Paging.h index 8dedf65f..e5487e22 100644 --- a/src/kernel/HALKit/ARM64/Paging.h +++ b/src/kernel/HALKit/ARM64/Paging.h @@ -40,10 +40,14 @@ /// Long format address range -#define cPageMAll {0b000, 0b000} -#define cPageMToMax(M) {M, 0b000} -#define cPageMaxToM(M) {0b000, M} -#define cPageMToN(M, N) {M, N} +#define cPageMAll \ + { 0b000, 0b000 } +#define cPageMToMax(M) \ + { M, 0b000 } +#define cPageMaxToM(M) \ + { 0b000, M } +#define cPageMToN(M, N) \ + { M, N } namespace Kernel::HAL { struct PACKED PTE_4KB final { @@ -81,9 +85,7 @@ namespace Detail { PageEnable = 31, }; - inline UInt8 control_register_cast(ControlRegisterBits reg) { - return static_cast<UInt8>(reg); - } + inline UInt8 control_register_cast(ControlRegisterBits reg) { return static_cast<UInt8>(reg); } } // namespace Detail struct PDE_4KB final { diff --git a/src/kernel/HALKit/POWER/HalApplicationProcessor.cc b/src/kernel/HALKit/POWER/HalApplicationProcessor.cc index 64333086..63292418 100644 --- a/src/kernel/HALKit/POWER/HalApplicationProcessor.cc +++ b/src/kernel/HALKit/POWER/HalApplicationProcessor.cc @@ -10,7 +10,8 @@ namespace Kernel::Detail { STATIC void mp_hang_fn(void) { - while (YES); + while (YES) + ; } } // namespace Kernel::Detail diff --git a/src/kernel/HALKit/RISCV/HalApplicationProcessor.cc b/src/kernel/HALKit/RISCV/HalApplicationProcessor.cc index 68242f97..6c882acf 100644 --- a/src/kernel/HALKit/RISCV/HalApplicationProcessor.cc +++ b/src/kernel/HALKit/RISCV/HalApplicationProcessor.cc @@ -11,7 +11,8 @@ using namespace Kernel; namespace Kernel { namespace Detail { STATIC void mp_hang_fn(void) { - while (YES); + while (YES) + ; } } // namespace Detail diff --git a/src/kernel/KernelKit/CoreProcessScheduler.h b/src/kernel/KernelKit/CoreProcessScheduler.h index a6f817f7..c87e4cec 100644 --- a/src/kernel/KernelKit/CoreProcessScheduler.h +++ b/src/kernel/KernelKit/CoreProcessScheduler.h @@ -59,11 +59,19 @@ struct ProcessHeapTree { TreeKind Color{TreeKind::kBlackTreeKind}; - struct ProcessHeapTree<T>* Parent{nullptr}; - struct ProcessHeapTree<T>* Child{nullptr}; - - struct ProcessHeapTree<T>* Prev{nullptr}; - struct ProcessHeapTree<T>* Next{nullptr}; + struct ProcessHeapTree<T>* Parent { + nullptr + }; + struct ProcessHeapTree<T>* Child { + nullptr + }; + + struct ProcessHeapTree<T>* Prev { + nullptr + }; + struct ProcessHeapTree<T>* Next { + nullptr + }; }; template <typename T> @@ -78,13 +86,21 @@ struct ProcessFileTree { TreeKind Color{TreeKind::kBlackTreeKind}; - struct ProcessFileTree<T>* Parent{nullptr}; + struct ProcessFileTree<T>* Parent { + nullptr + }; - struct ProcessFileTree<T>* Child{nullptr}; + struct ProcessFileTree<T>* Child { + nullptr + }; - struct ProcessFileTree<T>* Prev{nullptr}; + struct ProcessFileTree<T>* Prev { + nullptr + }; - struct ProcessFileTree<T>* Next{nullptr}; + struct ProcessFileTree<T>* Next { + nullptr + }; }; template <typename T> @@ -105,13 +121,21 @@ struct ProcessSpecialTree { TreeKind Color{TreeKind::kBlackTreeKind}; - struct ProcessSpecialTree<T>* Parent{nullptr}; + struct ProcessSpecialTree<T>* Parent { + nullptr + }; - struct ProcessSpecialTree<T>* Child{nullptr}; + struct ProcessSpecialTree<T>* Child { + nullptr + }; - struct ProcessSpecialTree<T>* Prev{nullptr}; + struct ProcessSpecialTree<T>* Prev { + nullptr + }; - struct ProcessSpecialTree<T>* Next{nullptr}; + struct ProcessSpecialTree<T>* Next { + nullptr + }; }; /***********************************************************************************/ diff --git a/src/kernel/KernelKit/DriveMgr.h b/src/kernel/KernelKit/DriveMgr.h index 5c13460b..ad17c5a6 100644 --- a/src/kernel/KernelKit/DriveMgr.h +++ b/src/kernel/KernelKit/DriveMgr.h @@ -72,7 +72,7 @@ struct DriveTrait final { Void (*fOutput)(DrivePacket& packet){nullptr}; Void (*fVerify)(DrivePacket& packet){nullptr}; Void (*fInit)(DrivePacket& packet){nullptr}; - const Char* (*fProtocol)(Void) {nullptr}; + const Char* (*fProtocol)(Void){nullptr}; }; namespace Probe { diff --git a/src/kernel/KernelKit/HardwareThreadScheduler.h b/src/kernel/KernelKit/HardwareThreadScheduler.h index 6813fcfe..ec03d7c2 100644 --- a/src/kernel/KernelKit/HardwareThreadScheduler.h +++ b/src/kernel/KernelKit/HardwareThreadScheduler.h @@ -63,10 +63,10 @@ class HardwareThread final { BOOL IsWakeup(); public: - HAL::StackFramePtr StackFrame(); + HAL::StackFramePtr StackFrame(); _Output const ThreadKind& Kind(); BOOL IsBusy(); - _Output const ThreadID& ID(); + _Output const ThreadID& ID(); private: HAL::StackFramePtr fStack{}; @@ -101,7 +101,7 @@ class HardwareThreadScheduler final : public ISchedulable { public: Ref<HardwareThread*> operator[](SizeT idx); bool operator!(); - operator bool(); + operator bool(); Bool IsUser() override { return Yes; } diff --git a/src/kernel/KernelKit/ILoader.h b/src/kernel/KernelKit/ILoader.h index 8399e1ea..786cf3ee 100644 --- a/src/kernel/KernelKit/ILoader.h +++ b/src/kernel/KernelKit/ILoader.h @@ -22,9 +22,9 @@ class ILoader { public: virtual _Output ErrorOr<VoidPtr> GetBlob() { return ErrorOr<VoidPtr>{}; } - virtual _Output const Char* AsString() { return ""; } - virtual _Output const Char* MIME() { return ""; } - virtual _Output const Char* Path() { return ""; } + virtual _Output const Char* AsString() { return ""; } + virtual _Output const Char* MIME() { return ""; } + virtual _Output const Char* Path() { return ""; } virtual _Output ErrorOr<VoidPtr> FindStart() { return ErrorOr<VoidPtr>{}; } virtual _Output ErrorOr<VoidPtr> FindSymbol(_Input const Char*, _Input Int32) { return ErrorOr<VoidPtr>{}; diff --git a/src/kernel/KernelKit/PCI/DMA.h b/src/kernel/KernelKit/PCI/DMA.h index 38854f31..11b044cd 100644 --- a/src/kernel/KernelKit/PCI/DMA.h +++ b/src/kernel/KernelKit/PCI/DMA.h @@ -46,7 +46,7 @@ class DMAWrapper final { T* Get(UIntPtr off = 0); public: - operator bool(); + operator bool(); bool operator!(); public: diff --git a/src/kernel/KernelKit/Semaphore.h b/src/kernel/KernelKit/Semaphore.h index 0a74a771..523d184f 100644 --- a/src/kernel/KernelKit/Semaphore.h +++ b/src/kernel/KernelKit/Semaphore.h @@ -18,8 +18,8 @@ #define kSemaphoreCount (2U) -#define kSemaphoreIncrementOwner(sem) (sem[kSemaphoreOwnerIndex]++) -#define kSemaphoreDecrementOwner(sem) (sem[kSemaphoreOwnerIndex]--) +#define kSemaphoreIncrementOwner(sem) (++sem[kSemaphoreOwnerIndex]) +#define kSemaphoreDecrementOwner(sem) (--sem[kSemaphoreOwnerIndex]) namespace Kernel { diff --git a/src/kernel/KernelKit/ThreadLocalStorage.h b/src/kernel/KernelKit/ThreadLocalStorage.h index 42310d87..a314ba38 100644 --- a/src/kernel/KernelKit/ThreadLocalStorage.h +++ b/src/kernel/KernelKit/ThreadLocalStorage.h @@ -29,6 +29,7 @@ struct THREAD_INFORMATION_BLOCK; struct PACKED THREAD_INFORMATION_BLOCK final { Kernel::Char Cookie[kCookieMagLen]{0}; //! Thread Magic Number. Kernel::VoidPtr UserData{nullptr}; //! Thread Information Record (User defined canary structure) + Char Pad{}; }; ///! @brief Cookie Sanity check. diff --git a/src/kernel/KernelKit/Timer.h b/src/kernel/KernelKit/Timer.h index 77437f01..4e6b866d 100644 --- a/src/kernel/KernelKit/Timer.h +++ b/src/kernel/KernelKit/Timer.h @@ -11,6 +11,7 @@ namespace Kernel { class SoftwareTimer; +class HardwareTimer; class ITimer; inline constexpr Int16 kTimeUnit = 1000; diff --git a/src/kernel/KernelKit/UserMgr+User.h b/src/kernel/KernelKit/UserMgr+User.h new file mode 100644 index 00000000..c14d609e --- /dev/null +++ b/src/kernel/KernelKit/UserMgr+User.h @@ -0,0 +1,101 @@ +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) +// Licensed under the Apache License, Version 2.0 (see LICENSE file) +// Official repository: https://github.com/nekernel-org/nekernel + +#ifndef KERNELKIT_USERMGR_USER_H +#define KERNELKIT_USERMGR_USER_H + +/* ======================================== + + Revision History: + + 04/03/25: Set users directory as /users/ instead of /usr/ + + ======================================== */ + +#include <CompilerKit/CompilerKit.h> +#include <KernelKit/KPC.h> +#include <NeKit/Config.h> +#include <NeKit/KString.h> + +///! We got the MGMT, STD (%s format) and GUEST users, +///! all are used to make authorized operations. +#define kMgmtUser "NEKERNEL/MGMT/%s" +#define kGuestUser "NEKERNEL/GUEST/%s" +#define kStdUser "NEKERNEL/STD/%s" + +#define kUsersDir "/users/" + +#define kMaxUserNameLen (256U) +#define kMaxUserTokenLen (256U) + +namespace Kernel { + +class User; + +enum struct UserRingKind : Int32 { + kRingInvalid = 0, + kRingStdUser = 444, + kRingSuperUser = 666, + kRingGuestUser = 777, + kRingCount = 3, +}; + +using UserPublicKey = Char*; +using UserPublicKeyType = Char; + +/// @brief System User class. +class User final { + public: + User() = delete; + + User(const Int32& sel, const Char* username); + User(const UserRingKind& kind, const Char* username); + + ~User(); + + public: + NE_COPY_DEFAULT(User) + + public: + bool operator==(const User& lhs); + bool operator!=(const User& lhs); + + public: + /// @brief Get software ring + const UserRingKind& Ring(); + + /// @brief Get user name + Char* Name(); + + /// @brief Is he a standard user? + Bool IsStdUser(); + + /// @brief Is she a super user? + Bool IsSuperUser(); + + /// @brief Saves a password from the public key. + Bool Save(const UserPublicKey password); + + /// @brief Checks if a password matches the **password**. + /// @param password the password to check. + Bool Login(const UserPublicKey password); + + private: + UserRingKind mUserRing{UserRingKind::kRingStdUser}; + Char mUserName[kMaxUserNameLen] = {0}; + UInt64 mUserFNV{0UL}; +}; + +/// \brief Alias for user ptr. +using UserPtr = User*; + +/// \brief Current user pointer. +inline UserPtr kCurrentUser = nullptr; + +/// \brief Supervisor pointer. +inline UserPtr kRootUser = nullptr; + +} // namespace Kernel + +#endif /* ifndef KERNELKIT_USERMGR_USER_H */ diff --git a/src/kernel/KernelKit/UserMgr.h b/src/kernel/KernelKit/UserMgr.h index e568dd45..66f5a129 100644 --- a/src/kernel/KernelKit/UserMgr.h +++ b/src/kernel/KernelKit/UserMgr.h @@ -1,101 +1,10 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/nekernel-org/nekernel #ifndef KERNELKIT_USERMGR_H #define KERNELKIT_USERMGR_H -/* ======================================== +#include <KernelKit/UserMgr+User.h> - Revision History: - - 04/03/25: Set users directory as /users/ instead of /usr/ - - ======================================== */ - -#include <CompilerKit/CompilerKit.h> -#include <KernelKit/KPC.h> -#include <NeKit/Config.h> -#include <NeKit/KString.h> - -///! We got the MGMT, STD (%s format) and GUEST users, -///! all are used to make authorized operations. -#define kMgmtUser "NEKERNEL/MGMT/%s" -#define kGuestUser "NEKERNEL/GUEST/%s" -#define kStdUser "NEKERNEL/STD/%s" - -#define kUsersDir "/users/" - -#define kMaxUserNameLen (256U) -#define kMaxUserTokenLen (256U) - -namespace Kernel { - -class User; - -enum struct UserRingKind : Int32 { - kRingInvalid = 0, - kRingStdUser = 444, - kRingSuperUser = 666, - kRingGuestUser = 777, - kRingCount = 3, -}; - -using UserPublicKey = Char*; -using UserPublicKeyType = Char; - -/// @brief System User class. -class User final { - public: - User() = delete; - - User(const Int32& sel, const Char* username); - User(const UserRingKind& kind, const Char* username); - - ~User(); - - public: - NE_COPY_DEFAULT(User) - - public: - bool operator==(const User& lhs); - bool operator!=(const User& lhs); - - public: - /// @brief Get software ring - const UserRingKind& Ring(); - - /// @brief Get user name - Char* Name(); - - /// @brief Is he a standard user? - Bool IsStdUser(); - - /// @brief Is she a super user? - Bool IsSuperUser(); - - /// @brief Saves a password from the public key. - Bool Save(const UserPublicKey password); - - /// @brief Checks if a password matches the **password**. - /// @param password the password to check. - Bool Login(const UserPublicKey password); - - private: - UserRingKind mUserRing{UserRingKind::kRingStdUser}; - Char mUserName[kMaxUserNameLen] = {0}; - UInt64 mUserFNV{0UL}; -}; - -/// \brief Alias for user ptr. -using UserPtr = User*; - -/// \brief Current running user. -inline UserPtr kCurrentUser = nullptr; - -/// \brief Super user. -inline UserPtr kRootUser = nullptr; - -} // namespace Kernel - -#endif /* ifndef KERNELKIT_USERMGR_H */ +#endif
\ No newline at end of file diff --git a/src/kernel/KernelKit/UserProcessScheduler.h b/src/kernel/KernelKit/UserProcessScheduler.h index 79513b83..6db304f8 100644 --- a/src/kernel/KernelKit/UserProcessScheduler.h +++ b/src/kernel/KernelKit/UserProcessScheduler.h @@ -12,7 +12,7 @@ #include <ArchKit/ArchKit.h> #include <KernelKit/CoreProcessScheduler.h> #include <KernelKit/LockDelegate.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/MutableArray.h> //////////////////////////////////////////////////// diff --git a/src/kernel/NeKit/Config.h b/src/kernel/NeKit/Config.h index c012e008..a9ba8b8a 100644 --- a/src/kernel/NeKit/Config.h +++ b/src/kernel/NeKit/Config.h @@ -16,7 +16,7 @@ #define NE_ICODEC \ final: \ - public \ + public \ ::Kernel::ICodec /// @brief The **NeKernel** namespace. @@ -112,12 +112,12 @@ inline Args&& move(Args&& arg) { template <class Type> concept IsSerializable = requires() { - { Type::kValue }; + {Type::kValue}; }; template <class Type> concept IsNotSerializable = requires() { - { !Type::kValue }; + {!Type::kValue}; }; /// @brief Encoding interface, used as a proxy to convert T to Char* diff --git a/src/kernel/NeKit/Macros.h b/src/kernel/NeKit/Macros.h index c0fc57f4..3a6e26fa 100644 --- a/src/kernel/NeKit/Macros.h +++ b/src/kernel/NeKit/Macros.h @@ -15,7 +15,7 @@ #endif #ifndef kib_cast -#define kib_cast(X) (Kernel::UInt64)((X) * 1024) +#define kib_cast(X) (Kernel::UInt64)((X) *1024) #endif #ifndef MIB @@ -116,7 +116,7 @@ #define NE_UNUSED(X) ((Kernel::Void) X) #ifndef RGB -#define RGB(R, G, B) ((Kernel::UInt32) ((0xFF << 24) | ((R) << 16) | ((G) << 8) | (B))) +#define RGB(R, G, B) ((Kernel::UInt32)((0xFF << 24) | ((R) << 16) | ((G) << 8) | (B))) #endif // !RGB #ifdef __NE_AMD64__ diff --git a/src/kernel/NeKit/Utils.h b/src/kernel/NeKit/Utils.h index e28e23eb..8ee1371b 100644 --- a/src/kernel/NeKit/Utils.h +++ b/src/kernel/NeKit/Utils.h @@ -54,9 +54,9 @@ inline constexpr SizeT oe_string_len(const CharType* str) { if (!str) return 0; #if __cplusplus == 202302L - if consteval { - return ARRAY_SIZE(str); - } else { + if + consteval { return ARRAY_SIZE(str); } + else { SizeT len{0}; while (str[len] != 0) ++len; return len; diff --git a/src/kernel/NeKit/Vettable.h b/src/kernel/NeKit/Vettable.h index 5c2fd211..f6aba645 100644 --- a/src/kernel/NeKit/Vettable.h +++ b/src/kernel/NeKit/Vettable.h @@ -15,10 +15,14 @@ namespace Kernel { template <class Type> -concept IsVettable = requires(Type) { (Type::kVettable); }; +concept IsVettable = requires(Type) { + (Type::kVettable); +}; template <class Type> -concept IsUnVettable = requires(Type) { (Type::kUnvettable); }; +concept IsUnVettable = requires(Type) { + (Type::kUnvettable); +}; } // namespace Kernel #endif // !__NE_KIT_VETTABLE_H__ diff --git a/src/kernel/amd64-ci.make b/src/kernel/amd64-ci.make index ad0e96b3..7db79b03 100644 --- a/src/kernel/amd64-ci.make +++ b/src/kernel/amd64-ci.make @@ -5,7 +5,7 @@ CXX = x86_64-w64-mingw32-g++ LD = x86_64-w64-mingw32-ld -CCFLAGS = -fshort-wchar -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Werror -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEKERNEL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot +CCFLAGS = -fshort-wchar -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Werror -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__FSKIT_INCLUDES_NEFS__ -D__NEKERNEL__ -D__HAVE_NE_API__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot ASM = nasm diff --git a/src/kernel/amd64-desktop.make b/src/kernel/amd64-desktop.make index f30c47df..cbaef256 100644 --- a/src/kernel/amd64-desktop.make +++ b/src/kernel/amd64-desktop.make @@ -6,7 +6,7 @@ CXX = x86_64-w64-mingw32-g++ LD = x86_64-w64-mingw32-ld CCFLAGS = -fshort-wchar -D__nekernel_dma_pool_start=0x1000000 -D__nekernel_dma_pool_size=0x1000000 \ - -D__nekernel_halkit_include_processor="<HALKit/AMD64/Processor.h>" -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__FSKIT_INCLUDES_OPENHEFS__ -D__FSKIT_INCLUDES_EXT2__ -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__NEKERNEL__ -D__HAVE_NE_APIS__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot + -D__nekernel_halkit_include_processor="<HALKit/AMD64/Processor.h>" -D__nekernel_max_cores=8 -c -D__NE_AMD64__ -D__NEOSKRNL__ -D__NE_VEPM__ -Wall -Wpedantic -Wextra -mno-red-zone -fno-rtti -fno-exceptions -std=c++20 -D__FSKIT_INCLUDES_OPENHEFS__ -D__FSKIT_INCLUDES_EXT2__ -D__NE_SUPPORT_NX__ -O0 -I../vendor -D__NEKERNEL__ -D__HAVE_NE_API__ -D__FREESTANDING__ -D__NE_VIRTUAL_MEMORY_SUPPORT__ -D__NE_AUTO_FORMAT__ -D__NE__ -I./ -I../ -I../boot ASM = nasm diff --git a/src/kernel/arm64-desktop.make b/src/kernel/arm64-desktop.make index d24203c1..db48b217 100644 --- a/src/kernel/arm64-desktop.make +++ b/src/kernel/arm64-desktop.make @@ -7,7 +7,7 @@ CC = clang++ LD = lld-link CCFLAGS = -fshort-wchar -c -ffreestanding -MMD -mno-red-zone -D__NE_ARM64__ -fno-rtti -fno-exceptions -I./ \ -target aarch64-unknown-windows \ - -std=c++20 -D__nekernel_max_cores -O3 -D__NEKERNEL__ -D__NEOSKRNL__ -D__NE_VEPM__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_APIS__ -D__NE__ -I../ + -std=c++20 -D__nekernel_max_cores -O3 -D__NEKERNEL__ -D__NEOSKRNL__ -D__NE_VEPM__ -D__NE_MINIMAL_OS__ -D__NE_NO_BUILTIN__ -D__HAVE_NE_API__ -D__NE__ -I../ ASM = clang++ diff --git a/src/kernel/src/AsciiUtils.cc b/src/kernel/src/AsciiUtils.cc index 08d6464b..e7eb8cd6 100644 --- a/src/kernel/src/AsciiUtils.cc +++ b/src/kernel/src/AsciiUtils.cc @@ -70,7 +70,8 @@ Void rt_zero_memory(voidPtr pointer, Size len) { #ifdef __NE_ENFORCE_DEPRECATED_WARNINGS [[deprecated("Use rt_set_memory_safe instead")]] #endif -voidPtr rt_set_memory(voidPtr src, UInt32 value, Size len) { +voidPtr +rt_set_memory(voidPtr src, UInt32 value, Size len) { if (!src) return nullptr; auto p = reinterpret_cast<UInt8*>(src); UInt8 v = static_cast<UInt8>(value & 0xFF); diff --git a/src/kernel/src/BitMapMgr.cc b/src/kernel/src/BitMapMgr.cc index 1aee57b6..c00c71ae 100644 --- a/src/kernel/src/BitMapMgr.cc +++ b/src/kernel/src/BitMapMgr.cc @@ -155,9 +155,7 @@ namespace HAL { STATIC Detail::IBitMapProxy kBitMapMgr; - auto mm_is_bitmap(VoidPtr ptr) -> BOOL { - return kBitMapMgr.IsBitMap(ptr); - } + auto mm_is_bitmap(VoidPtr ptr) -> BOOL { return kBitMapMgr.IsBitMap(ptr); } /***********************************************************************************/ /// @brief Allocate a new page to be used by the OS. diff --git a/src/kernel/src/FS/NeFS+FileSystemParser.cc b/src/kernel/src/FS/NeFS+FileSystemParser.cc index cdbb92b1..d17e1288 100644 --- a/src/kernel/src/FS/NeFS+FileSystemParser.cc +++ b/src/kernel/src/FS/NeFS+FileSystemParser.cc @@ -11,7 +11,7 @@ #include <KernelKit/IFS.h> #include <KernelKit/KPC.h> #include <KernelKit/ProcessScheduler.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/Crc32.h> #include <NeKit/KString.h> #include <NeKit/KernelPanic.h> @@ -152,8 +152,8 @@ _Output BOOL NeFileSystemParser::CreateFork(_Input NEFS_FORK_STRUCT& the_fork) { /// @return the newly found fork. /***********************************************************************************/ _Output NEFS_FORK_STRUCT* NeFileSystemParser::FindFork(_Input NEFS_CATALOG_STRUCT* catalog, - _Input const Char* name, - _Input Boolean is_data) { + _Input const Char* name, + _Input Boolean is_data) { if (!catalog || !name) return nullptr; auto& drive = kMountpoint.A(); @@ -215,7 +215,7 @@ _Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char /// @param kind the catalog kind. /// @return catalog pointer. /***********************************************************************************/ -_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name, +_Output NEFS_CATALOG_STRUCT* NeFileSystemParser::CreateCatalog(_Input const Char* name, _Input const Int32& flags, _Input const Int32& kind) { kout << "CreateCatalog(*...*)\r"; diff --git a/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc b/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc index 93cc5a63..e2413cbe 100644 --- a/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc +++ b/src/kernel/src/FS/OpenHeFS+FileSystemParser.cc @@ -9,7 +9,7 @@ #include <FirmwareKit/GPT.h> #include <KernelKit/KPC.h> #include <KernelKit/ProcessScheduler.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/Crc32.h> #include <NeKit/KString.h> #include <NeKit/KernelPanic.h> diff --git a/src/kernel/src/IndexableProperty.cc b/src/kernel/src/IndexableProperty.cc index 49063950..b3828e48 100644 --- a/src/kernel/src/IndexableProperty.cc +++ b/src/kernel/src/IndexableProperty.cc @@ -16,21 +16,13 @@ namespace Kernel { namespace Indexer { - Index& IndexableProperty::Leak() { - return fIndex; - } + Index& IndexableProperty::Leak() { return fIndex; } - Void IndexableProperty::AddFlag(UInt16 flag) { - fFlags |= flag; - } + Void IndexableProperty::AddFlag(UInt16 flag) { fFlags |= flag; } - Void IndexableProperty::RemoveFlag(UInt16 flag) { - fFlags &= ~(flag); - } + Void IndexableProperty::RemoveFlag(UInt16 flag) { fFlags &= ~(flag); } - UInt16 IndexableProperty::HasFlag(UInt16 flag) { - return fFlags & flag; - } + UInt16 IndexableProperty::HasFlag(UInt16 flag) { return fFlags & flag; } /// @brief Index a file into the indexer instance. /// @param filename filesystem path to access. diff --git a/src/kernel/src/PE32CodeMgr.cc b/src/kernel/src/PE32CodeMgr.cc index 2bb8d941..1cfaa524 100644 --- a/src/kernel/src/PE32CodeMgr.cc +++ b/src/kernel/src/PE32CodeMgr.cc @@ -18,7 +18,7 @@ #define kPeImageStart "__ImageStart" namespace Kernel { - + namespace Detail { /***********************************************************************************/ /// @brief Get the PE32+ platform signature according to the compiled architecture. diff --git a/src/kernel/src/PEFCodeMgr.cc b/src/kernel/src/PEFCodeMgr.cc index 82d90ec1..db140ba4 100644 --- a/src/kernel/src/PEFCodeMgr.cc +++ b/src/kernel/src/PEFCodeMgr.cc @@ -302,8 +302,7 @@ ProcessID rtl_create_user_process(PEFLoader& exec, auto symname = exec.FindSymbol(kPefNameSymbol, kPefCode); - if (!symname.Leak().Leak()) - symname = ErrorOr<VoidPtr>{(VoidPtr) rt_alloc_string(kPefImageStart)}; + if (!symname.Leak().Leak()) symname = ErrorOr<VoidPtr>{(VoidPtr) rt_alloc_string(kPefImageStart)}; if (!symname.Leak().Leak()) return kSchedInvalidPID; diff --git a/src/kernel/src/UserMgr+User.cc b/src/kernel/src/UserMgr+User.cc index 9c6eda0e..f46a5590 100644 --- a/src/kernel/src/UserMgr+User.cc +++ b/src/kernel/src/UserMgr+User.cc @@ -6,7 +6,7 @@ #include <KernelKit/HeapMgr.h> #include <KernelKit/KPC.h> #include <KernelKit/ThreadLocalStorage.h> -#include <KernelKit/UserMgr.h> +#include <KernelKit/UserMgr+User.h> #include <NeKit/KString.h> #include <NeKit/KernelPanic.h> #include <NeKit/Utils.h> diff --git a/src/kernel/src/UserProcessScheduler.cc b/src/kernel/src/UserProcessScheduler.cc index de6e959f..3b9e1a0f 100644 --- a/src/kernel/src/UserProcessScheduler.cc +++ b/src/kernel/src/UserProcessScheduler.cc @@ -111,7 +111,7 @@ ErrorOr<VoidPtr> UserProcess::New(SizeT sz, SizeT pad_amount) { hal_write_cr3(vm_register); #else - auto ptr = mm_alloc_ptr(sz, Yes, Yes, pad_amount); + auto ptr = mm_alloc_ptr(sz, Yes, Yes, pad_amount); #endif if (!this->HeapTree) { |
