From ba7b3ed69cd24970a28b72c54982735cd120e663 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 28 Mar 2025 19:57:33 +0100 Subject: kernel: breaking: Change namespace from NeOS to Kernel. sched: Fix redundancy in NeKernel's user scheduler macros, refactored the other files using the redundant macros too. part one of a series of commit for NeKernel. Signed-off-by: Amlal El Mahrouss --- dev/kernel/HALKit/ARM64/APM/APM+IO.cc | 2 +- dev/kernel/HALKit/ARM64/ApplicationProcessor.h | 4 ++-- dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc | 4 ++-- dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc | 4 ++-- dev/kernel/HALKit/ARM64/HalDebugOutput.cc | 6 +++--- dev/kernel/HALKit/ARM64/HalKernelMain.cc | 8 ++++---- dev/kernel/HALKit/ARM64/HalKernelPanic.cc | 6 +++--- dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc | 4 ++-- dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc | 4 ++-- dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc | 4 ++-- dev/kernel/HALKit/ARM64/Paging.h | 8 ++++---- dev/kernel/HALKit/ARM64/Processor.h | 10 +++++----- 12 files changed, 32 insertions(+), 32 deletions(-) (limited to 'dev/kernel/HALKit/ARM64') diff --git a/dev/kernel/HALKit/ARM64/APM/APM+IO.cc b/dev/kernel/HALKit/ARM64/APM/APM+IO.cc index 5fb45452..384fc7b1 100644 --- a/dev/kernel/HALKit/ARM64/APM/APM+IO.cc +++ b/dev/kernel/HALKit/ARM64/APM/APM+IO.cc @@ -7,7 +7,7 @@ #include #include -using namespace NeOS; +using namespace Kernel; /// @brief Send APM command to it's space. /// @param base_dma the IO base port. diff --git a/dev/kernel/HALKit/ARM64/ApplicationProcessor.h b/dev/kernel/HALKit/ARM64/ApplicationProcessor.h index d263f9b8..e987cf81 100644 --- a/dev/kernel/HALKit/ARM64/ApplicationProcessor.h +++ b/dev/kernel/HALKit/ARM64/ApplicationProcessor.h @@ -13,7 +13,7 @@ /* INITIALIZE THE GIC ON CPU. */ /************************************************** */ -namespace NeOS +namespace Kernel { - BOOL mp_initialize_gic(NeOS::Void); + BOOL mp_initialize_gic(Kernel::Void); } \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc b/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc index a25112ae..9ba83c3d 100644 --- a/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc +++ b/dev/kernel/HALKit/ARM64/HalACPIFactoryInterface.cc @@ -10,7 +10,7 @@ #include #include -namespace NeOS +namespace Kernel { ACPIFactoryInterface::ACPIFactoryInterface(VoidPtr rsp_ptr) : fRsdp(rsp_ptr), fEntries(0) @@ -29,4 +29,4 @@ namespace NeOS { apm_send_io_command(kAPMPowerCommandReboot, 0); } -} // namespace NeOS +} // namespace Kernel diff --git a/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc b/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc index 660af502..60f5bda3 100644 --- a/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc +++ b/dev/kernel/HALKit/ARM64/HalApplicationProcessor.cc @@ -28,7 +28,7 @@ // ================================================================= // -namespace NeOS +namespace Kernel { struct PROCESS_CONTROL_BLOCK final { @@ -142,4 +142,4 @@ namespace NeOS return Detail::kGICEnabled; } -} // namespace NeOS \ No newline at end of file +} // namespace Kernel \ No newline at end of file diff --git a/dev/kernel/HALKit/ARM64/HalDebugOutput.cc b/dev/kernel/HALKit/ARM64/HalDebugOutput.cc index 8d54739f..5c668605 100644 --- a/dev/kernel/HALKit/ARM64/HalDebugOutput.cc +++ b/dev/kernel/HALKit/ARM64/HalDebugOutput.cc @@ -9,7 +9,7 @@ #include #include -namespace NeOS +namespace Kernel { EXTERN_C void ke_io_write(IDeviceObject* self, const Char* bytes) { @@ -76,8 +76,8 @@ namespace NeOS TerminalDevice TerminalDevice::The() noexcept { - TerminalDevice out(NeOS::ke_io_write, NeOS::ke_io_read); + TerminalDevice out(Kernel::ke_io_write, Kernel::ke_io_read); return out; } -} // namespace NeOS +} // namespace Kernel diff --git a/dev/kernel/HALKit/ARM64/HalKernelMain.cc b/dev/kernel/HALKit/ARM64/HalKernelMain.cc index 55caca94..e5ee3d42 100644 --- a/dev/kernel/HALKit/ARM64/HalKernelMain.cc +++ b/dev/kernel/HALKit/ARM64/HalKernelMain.cc @@ -21,7 +21,7 @@ #include EXTERN_C void hal_init_platform( - NeOS::HEL::BootInfoHeader* handover_hdr) + Kernel::HEL::BootInfoHeader* handover_hdr) { /************************************************** */ @@ -41,12 +41,12 @@ EXTERN_C void hal_init_platform( /************************************** */ kKernelBitMpSize = kHandoverHeader->f_BitMapSize; - kKernelBitMpStart = reinterpret_cast( - reinterpret_cast(kHandoverHeader->f_BitMapStart)); + kKernelBitMpStart = reinterpret_cast( + reinterpret_cast(kHandoverHeader->f_BitMapStart)); /// @note do initialize the interrupts after it. - NeOS::mp_initialize_gic(); + Kernel::mp_initialize_gic(); while (YES) { diff --git a/dev/kernel/HALKit/ARM64/HalKernelPanic.cc b/dev/kernel/HALKit/ARM64/HalKernelPanic.cc index 5037f440..4001b05f 100644 --- a/dev/kernel/HALKit/ARM64/HalKernelPanic.cc +++ b/dev/kernel/HALKit/ARM64/HalKernelPanic.cc @@ -18,7 +18,7 @@ /* Each error code is attributed with an ID, which will prompt a string onto the * screen. Wait for debugger... */ -namespace NeOS +namespace Kernel { /// @brief Dumping factory class. class RecoveryFactory final @@ -31,7 +31,7 @@ namespace NeOS /// @brief Stops execution of the kernel. /// @param id kernel stop ID. /***********************************************************************************/ - Void ke_panic(const NeOS::Int32& id, const Char* message) + Void ke_panic(const Kernel::Int32& id, const Char* message) { fb_init(); @@ -77,4 +77,4 @@ namespace NeOS ke_panic(RUNTIME_CHECK_FAILED, file); // Runtime Check failed } } -} // namespace NeOS +} // namespace Kernel diff --git a/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc b/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc index 4ec45b51..8fa8422a 100644 --- a/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc +++ b/dev/kernel/HALKit/ARM64/HalPagingMgrARM64.cc @@ -10,7 +10,7 @@ #include #include -namespace NeOS::HAL +namespace Kernel::HAL { typedef UInt32 PageTableIndex; @@ -83,4 +83,4 @@ namespace NeOS::HAL return 0; } -} // namespace NeOS::HAL +} // namespace Kernel::HAL diff --git a/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc b/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc index 55c8aab5..629e4eca 100644 --- a/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc +++ b/dev/kernel/HALKit/ARM64/HalSchedulerCoreARM64.cc @@ -6,7 +6,7 @@ #include -namespace NeOS +namespace Kernel { /// @brief Wakes up thread. /// Wakes up thread from the hang state. @@ -21,4 +21,4 @@ namespace NeOS { NE_UNUSED(stack); } -} // namespace NeOS +} // namespace Kernel diff --git a/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc b/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc index 3a9b7074..00a11fac 100644 --- a/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc +++ b/dev/kernel/HALKit/ARM64/HalSchedulerCorePrimitivesARM64.cc @@ -7,7 +7,7 @@ #include #include -namespace NeOS +namespace Kernel { /***********************************************************************************/ /// @brief Unimplemented function (crashes by default) @@ -32,4 +32,4 @@ namespace NeOS return stack_ptr->SP != 0 && stack_ptr->BP != 0; } -} // namespace NeOS +} // namespace Kernel diff --git a/dev/kernel/HALKit/ARM64/Paging.h b/dev/kernel/HALKit/ARM64/Paging.h index 3c24f757..c27b982b 100644 --- a/dev/kernel/HALKit/ARM64/Paging.h +++ b/dev/kernel/HALKit/ARM64/Paging.h @@ -56,7 +56,7 @@ M, N \ } -namespace NeOS::HAL +namespace Kernel::HAL { struct PACKED PTE_4KB final { @@ -109,12 +109,12 @@ namespace NeOS::HAL auto mm_alloc_bitmap(Boolean wr, Boolean user, SizeT size, Bool is_page) -> VoidPtr; auto mm_free_bitmap(VoidPtr page_ptr) -> Bool; -} // namespace NeOS::HAL +} // namespace Kernel::HAL -namespace NeOS +namespace Kernel { typedef HAL::PTE_4KB PTE; typedef HAL::PDE_4KB PDE; -} // namespace NeOS +} // namespace Kernel EXTERN_C void hal_flush_tlb(); diff --git a/dev/kernel/HALKit/ARM64/Processor.h b/dev/kernel/HALKit/ARM64/Processor.h index 940cfbe9..cf600122 100644 --- a/dev/kernel/HALKit/ARM64/Processor.h +++ b/dev/kernel/HALKit/ARM64/Processor.h @@ -13,7 +13,7 @@ #define kCPUBackendName "ARMv8" -namespace NeOS::HAL +namespace Kernel::HAL { struct PACKED Register64 final { @@ -81,11 +81,11 @@ namespace NeOS::HAL { asm volatile("wfi"); } -} // namespace NeOS::HAL +} // namespace Kernel::HAL -inline NeOS::VoidPtr kKernelBitMpStart = nullptr; -inline NeOS::UIntPtr kKernelBitMpSize = 0UL; +inline Kernel::VoidPtr kKernelBitMpStart = nullptr; +inline Kernel::UIntPtr kKernelBitMpSize = 0UL; -inline NeOS::VoidPtr kKernelPhysicalStart = nullptr; +inline Kernel::VoidPtr kKernelPhysicalStart = nullptr; #include -- cgit v1.2.3