diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 15:01:34 -0500 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-29 15:01:34 -0500 |
| commit | ceabd82ac8e796249feacf39c836034ed5e11c6d (patch) | |
| tree | e446d471a0eaf4ed7ac67e878ce4fb02334a2acb /src/kernel/HALKit | |
| parent | 0376382a848ef5ebbb0e02428c9d1df8a099d8b4 (diff) | |
chore: source code review and fixes.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/kernel/HALKit')
24 files changed, 63 insertions, 73 deletions
diff --git a/src/kernel/HALKit/AMD64/HalAPICDmaWrapper.cc b/src/kernel/HALKit/AMD64/HalAPICDmaWrapper.cc index 36a027a2..79013b26 100644 --- a/src/kernel/HALKit/AMD64/HalAPICDmaWrapper.cc +++ b/src/kernel/HALKit/AMD64/HalAPICDmaWrapper.cc @@ -18,7 +18,7 @@ LAPICDmaWrapper::~LAPICDmaWrapper() = default; /// @brief Read from APIC controller. /// @param reg register. /***********************************************************************************/ -UInt32 LAPICDmaWrapper::Read(UInt16 reg) noexcept { +UInt32 LAPICDmaWrapper::Read(UInt16 reg) { MUST_PASS(this->fApic); UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic; @@ -30,7 +30,7 @@ UInt32 LAPICDmaWrapper::Read(UInt16 reg) noexcept { /// @param reg register. /// @param value value. /***********************************************************************************/ -Void LAPICDmaWrapper::Write(UInt16 reg, UInt32 value) noexcept { +Void LAPICDmaWrapper::Write(UInt16 reg, UInt32 value) { MUST_PASS(this->fApic); UInt32 volatile* io_apic = (UInt32 volatile*) this->fApic; diff --git a/src/kernel/HALKit/AMD64/HalApplicationProcessor.cc b/src/kernel/HALKit/AMD64/HalApplicationProcessor.cc index 02d7f885..9b352dcc 100644 --- a/src/kernel/HALKit/AMD64/HalApplicationProcessor.cc +++ b/src/kernel/HALKit/AMD64/HalApplicationProcessor.cc @@ -134,7 +134,7 @@ EXTERN_C BOOL mp_register_task(HAL::StackFramePtr stack_frame, ThreadID thrdid) /// @return True if YES, False if not. /***********************************************************************************/ -Bool mp_is_smp(Void) noexcept { +Bool mp_is_smp(Void) { return kSMPAware; } @@ -143,7 +143,7 @@ Bool mp_is_smp(Void) noexcept { /// @param vendor_ptr SMP containing structure. /***********************************************************************************/ -Void mp_init_cores(VoidPtr vendor_ptr) noexcept { +Void mp_init_cores(VoidPtr vendor_ptr) { if (!vendor_ptr) return; PowerFactoryInterface hw_and_pow_int{vendor_ptr}; diff --git a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc index f19e49b5..3745fe3c 100644 --- a/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc +++ b/src/kernel/HALKit/AMD64/HalCoreInterruptHandler.cc @@ -61,8 +61,7 @@ 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/HalDebugOutput.cc b/src/kernel/HALKit/AMD64/HalDebugOutput.cc index 8e5f4cbd..f35e7a57 100644 --- a/src/kernel/HALKit/AMD64/HalDebugOutput.cc +++ b/src/kernel/HALKit/AMD64/HalDebugOutput.cc @@ -26,7 +26,7 @@ namespace Detail { /// @brief Init COM1. /// @return template <UInt16 PORT> - bool hal_serial_init() noexcept { + bool hal_serial_init() { if (kState == kStateReady || kState == kStateTransmit) return true; HAL::rt_out8(PORT + 1, 0x00); // Disable all interrupts @@ -211,14 +211,14 @@ EXTERN_C void ke_io_read(DeviceInterface<const Char*>*, const Char* bytes) { #endif // __DEBUG__ } -TerminalDevice TerminalDevice::The() noexcept { +TerminalDevice TerminalDevice::The() { TerminalDevice out(Kernel::ke_io_write, Kernel::ke_io_read); return out; } Utf8TerminalDevice::~Utf8TerminalDevice() = default; -Utf8TerminalDevice Utf8TerminalDevice::The() noexcept { +Utf8TerminalDevice Utf8TerminalDevice::The() { Utf8TerminalDevice out(Kernel::ke_utf_io_write, [](DeviceInterface<const Utf8Char*>*, const Utf8Char*) -> Void {}); return out; diff --git a/src/kernel/HALKit/AMD64/HalKernelMain.cc b/src/kernel/HALKit/AMD64/HalKernelMain.cc index e23c5bc1..5f1d2430 100644 --- a/src/kernel/HALKit/AMD64/HalKernelMain.cc +++ b/src/kernel/HALKit/AMD64/HalKernelMain.cc @@ -154,7 +154,6 @@ 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/HalKernelPanic.cc b/src/kernel/HALKit/AMD64/HalKernelPanic.cc index 12538667..73121cbc 100644 --- a/src/kernel/HALKit/AMD64/HalKernelPanic.cc +++ b/src/kernel/HALKit/AMD64/HalKernelPanic.cc @@ -22,7 +22,7 @@ namespace Kernel { /// @brief Dumping factory class. class RecoveryFactory final { public: - STATIC Void Recover() noexcept; + STATIC Void Recover(); }; /***********************************************************************************/ @@ -39,7 +39,7 @@ Void ke_panic(const Kernel::Int32& id, const Char* message) { RecoveryFactory::Recover(); } -Void RecoveryFactory::Recover() noexcept { +Void RecoveryFactory::Recover() { while (YES) { HAL::rt_halt(); } diff --git a/src/kernel/HALKit/AMD64/HalProcessor.cc b/src/kernel/HALKit/AMD64/HalProcessor.cc index d202a758..cebf5e38 100644 --- a/src/kernel/HALKit/AMD64/HalProcessor.cc +++ b/src/kernel/HALKit/AMD64/HalProcessor.cc @@ -16,7 +16,7 @@ */ namespace Kernel::HAL { -inline Bool hal_has_msr() noexcept { +inline Bool hal_has_msr() { static UInt32 eax, unused, edx; // eax, edx __get_cpuid(1, &eax, &unused, &unused, &edx); @@ -25,12 +25,12 @@ inline Bool hal_has_msr() noexcept { return edx & (1 << 5); } -Void hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept { +Void hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) { if (!lo || !hi) return; asm volatile("rdmsr" : "=a"(*lo), "=d"(*hi) : "c"(msr)); } -Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi) noexcept { +Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi) { asm volatile("wrmsr" : : "a"(lo), "d"(hi), "c"(msr)); } diff --git a/src/kernel/HALKit/AMD64/HalTimer.cc b/src/kernel/HALKit/AMD64/HalTimer.cc index f6488b05..8d5c0737 100644 --- a/src/kernel/HALKit/AMD64/HalTimer.cc +++ b/src/kernel/HALKit/AMD64/HalTimer.cc @@ -79,7 +79,7 @@ HardwareTimer::~HardwareTimer() { /// @brief Wait for the timer to stop spinning.
/***********************************************************************************/
-BOOL HardwareTimer::Wait() noexcept {
+BOOL HardwareTimer::Wait() {
if (fWaitFor < 1) return NO;
if (fWaitFor > 1'000'000) return NO; // max 1000s = 16 minutes
diff --git a/src/kernel/HALKit/AMD64/Network/Generic+Basic+RTL8139.cc b/src/kernel/HALKit/AMD64/Network/Generic+Basic+RTL8139.cc index f9865139..db839994 100644 --- a/src/kernel/HALKit/AMD64/Network/Generic+Basic+RTL8139.cc +++ b/src/kernel/HALKit/AMD64/Network/Generic+Basic+RTL8139.cc @@ -25,7 +25,7 @@ STATIC UInt8* kRXBuffer = nullptr; ///@brief RTL8139 Init routine. /***********************************************************************************/ -EXTERN_C BOOL rtl_init_nic_rtl8139(UInt16 io_base) noexcept { +EXTERN_C BOOL rtl_init_nic_rtl8139(UInt16 io_base) { if (kTXRXEnabled) return NO; kRTLIOBase = io_base; diff --git a/src/kernel/HALKit/AMD64/Paging.h b/src/kernel/HALKit/AMD64/Paging.h index a938700e..3325d2c7 100644 --- a/src/kernel/HALKit/AMD64/Paging.h +++ b/src/kernel/HALKit/AMD64/Paging.h @@ -57,7 +57,9 @@ 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/Processor.h b/src/kernel/HALKit/AMD64/Processor.h index db1ed573..ec94a3f1 100644 --- a/src/kernel/HALKit/AMD64/Processor.h +++ b/src/kernel/HALKit/AMD64/Processor.h @@ -162,20 +162,20 @@ class IDTLoader final { /// @return True if YES, False if not. /***********************************************************************************/ -Bool mp_is_smp(Void) noexcept; +Bool mp_is_smp(Void); /***********************************************************************************/ /// @brief Fetch and enable SMP scheduler. /// @param vendor_ptr SMP containing structure. /***********************************************************************************/ -Void mp_init_cores(VoidPtr vendor_ptr) noexcept; +Void mp_init_cores(VoidPtr vendor_ptr); /***********************************************************************************/ /// @brief Do a cpuid to check if MSR exists on CPU. /// @retval true it does exists. /// @retval false it doesn't. /***********************************************************************************/ -Bool hal_has_msr() noexcept; +Bool hal_has_msr(); /***********************************************************************************/ /// @brief Get Model specific register inside core. @@ -183,13 +183,13 @@ Bool hal_has_msr() noexcept; /// @param lo low byte /// @param hi high byte /***********************************************************************************/ -Void hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi) noexcept; +Void hal_get_msr(UInt32 msr, UInt32* lo, UInt32* hi); /// @brief Set Model-specific register. /// @param msr MSR /// @param lo low byte /// @param hi high byte -Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi) noexcept; +Void hal_set_msr(UInt32 msr, UInt32 lo, UInt32 hi); /// @brief Processor specific namespace. namespace Detail { @@ -234,8 +234,8 @@ class LAPICDmaWrapper final { NE_COPY_DEFAULT(LAPICDmaWrapper) public: - UInt32 Read(UInt16 reg) noexcept; - Void Write(UInt16 reg, UInt32 value) noexcept; + UInt32 Read(UInt16 reg); + Void Write(UInt16 reg, UInt32 value); private: VoidPtr fApic{nullptr}; diff --git a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc index 14b40b98..51e73fca 100644 --- a/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/AHCI+Generic.cc @@ -64,11 +64,11 @@ STATIC ALIGN(kib_cast(4)) UInt8 kIdentifyData[kAHCISectorSize] = {0} template <BOOL Write, BOOL CommandOrCTRL, BOOL Identify> STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz, - SizeT size_buffer) noexcept; + SizeT size_buffer); -STATIC Int32 drv_find_cmd_slot_ahci(HbaPort* port) noexcept; +STATIC Int32 drv_find_cmd_slot_ahci(HbaPort* port); -STATIC Void drv_compute_disk_ahci() noexcept; +STATIC Void drv_compute_disk_ahci(); STATIC SizeT drv_get_size_ahci(); @@ -77,7 +77,7 @@ STATIC SizeT drv_get_sector_count_ahci(); /***********************************************************************************/ /// @brief Identify device and read LBA info, Disk OEM vendor. /***********************************************************************************/ -STATIC Void drv_compute_disk_ahci() noexcept { +STATIC Void drv_compute_disk_ahci() { kSATASectorCount = 0UL; rt_set_memory(kIdentifyData, 0, kAHCISectorSize); @@ -114,7 +114,7 @@ STATIC Void drv_compute_disk_ahci() noexcept { /// @param port The port to search on. /// @return The slot, or -1. /***********************************************************************************/ -STATIC Int32 drv_find_cmd_slot_ahci(HbaPort* port) noexcept { +STATIC Int32 drv_find_cmd_slot_ahci(HbaPort* port) { UInt32 slots = port->Sact | port->Ci; for (Int32 i = 0; i < kSATAPortCnt; ++i) // AHCI supports up to 32 slots @@ -134,7 +134,7 @@ STATIC Int32 drv_find_cmd_slot_ahci(HbaPort* port) noexcept { /***********************************************************************************/ template <BOOL Write, BOOL CommandOrCTRL, BOOL Identify> STATIC Void drv_std_input_output_ahci(UInt64 lba, UInt8* buffer, SizeT sector_sz, - SizeT size_buffer) noexcept { + SizeT size_buffer) { if (sector_sz == 0) { kout << "ahci: Invalid sector size.\r"; err_global_get() = kErrorDisk; @@ -294,8 +294,7 @@ 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: @@ -308,13 +307,15 @@ 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 cf6147d9..5a51d685 100644 --- a/src/kernel/HALKit/AMD64/Storage/DMA+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/DMA+Generic.cc @@ -105,7 +105,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); @@ -123,8 +123,7 @@ 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 @@ -147,7 +146,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); @@ -163,8 +162,7 @@ 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 0516be39..81a79c6f 100644 --- a/src/kernel/HALKit/AMD64/Storage/PIO+Generic.cc +++ b/src/kernel/HALKit/AMD64/Storage/PIO+Generic.cc @@ -83,8 +83,7 @@ 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... @@ -117,15 +116,14 @@ 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); @@ -149,15 +147,14 @@ 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/ApplicationProcessor.h b/src/kernel/HALKit/ARM64/ApplicationProcessor.h index 208bf82e..9768cebc 100644 --- a/src/kernel/HALKit/ARM64/ApplicationProcessor.h +++ b/src/kernel/HALKit/ARM64/ApplicationProcessor.h @@ -15,5 +15,5 @@ /************************************************** */ namespace Kernel { -Void mp_init_cores(Void) noexcept; +Void mp_init_cores(Void); }
\ No newline at end of file diff --git a/src/kernel/HALKit/ARM64/HalApplicationProcessor.cc b/src/kernel/HALKit/ARM64/HalApplicationProcessor.cc index 2a3c73e5..fff4282f 100644 --- a/src/kernel/HALKit/ARM64/HalApplicationProcessor.cc +++ b/src/kernel/HALKit/ARM64/HalApplicationProcessor.cc @@ -131,7 +131,7 @@ EXTERN_C Bool mp_register_task(HAL::StackFramePtr stack_frame, ProcessID thrdid) /// @brief Initialize the Global Interrupt Controller.
/// @internal
/***********************************************************************************/
-Void mp_init_cores(Void) noexcept {
+Void mp_init_cores(Void) {
if (!Detail::kGICEnabled) {
Detail::kGICEnabled = YES;
Detail::mp_setup_gic_el0();
diff --git a/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc b/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc index b89f68bd..3c18e837 100644 --- a/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc +++ b/src/kernel/HALKit/ARM64/HalCoreInterruptHandler.cc @@ -56,8 +56,7 @@ 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/HalDebugOutput.cc b/src/kernel/HALKit/ARM64/HalDebugOutput.cc index c0da9c3a..22a41dbf 100644 --- a/src/kernel/HALKit/ARM64/HalDebugOutput.cc +++ b/src/kernel/HALKit/ARM64/HalDebugOutput.cc @@ -63,7 +63,7 @@ EXTERN_C void ke_io_read(DeviceInterface<const Char*>* self, const Char* bytes) #endif // __DEBUG__ } -TerminalDevice TerminalDevice::The() noexcept { +TerminalDevice TerminalDevice::The() { TerminalDevice out(Kernel::ke_io_write, Kernel::ke_io_read); return out; } diff --git a/src/kernel/HALKit/ARM64/HalKernelMain.cc b/src/kernel/HALKit/ARM64/HalKernelMain.cc index e36535c3..1cd10838 100644 --- a/src/kernel/HALKit/ARM64/HalKernelMain.cc +++ b/src/kernel/HALKit/ARM64/HalKernelMain.cc @@ -57,7 +57,6 @@ 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/HalKernelPanic.cc b/src/kernel/HALKit/ARM64/HalKernelPanic.cc index 6837ba1c..6c3afe83 100644 --- a/src/kernel/HALKit/ARM64/HalKernelPanic.cc +++ b/src/kernel/HALKit/ARM64/HalKernelPanic.cc @@ -22,7 +22,7 @@ namespace Kernel { /// @brief Dumping factory class. class RecoveryFactory final { public: - STATIC Void Recover() noexcept; + STATIC Void Recover(); }; /***********************************************************************************/ @@ -37,7 +37,7 @@ Void ke_panic(const Kernel::Int32& id, const Char* message) { RecoveryFactory::Recover(); } -Void RecoveryFactory::Recover() noexcept { +Void RecoveryFactory::Recover() { while (YES) { HAL::rt_halt(); } diff --git a/src/kernel/HALKit/ARM64/Paging.h b/src/kernel/HALKit/ARM64/Paging.h index 766210b3..e8bd0ac1 100644 --- a/src/kernel/HALKit/ARM64/Paging.h +++ b/src/kernel/HALKit/ARM64/Paging.h @@ -41,14 +41,10 @@ /// 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 { @@ -86,7 +82,9 @@ 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/ARM64/Processor.h b/src/kernel/HALKit/ARM64/Processor.h index 716d317b..de9f932e 100644 --- a/src/kernel/HALKit/ARM64/Processor.h +++ b/src/kernel/HALKit/ARM64/Processor.h @@ -60,7 +60,7 @@ struct PACKED StackFrame { typedef StackFrame* StackFramePtr; -inline Void rt_halt() noexcept { +inline Void rt_halt() { while (Yes) { } } diff --git a/src/kernel/HALKit/POWER/HalApplicationProcessor.cc b/src/kernel/HALKit/POWER/HalApplicationProcessor.cc index 84d9b1c1..fa65deae 100644 --- a/src/kernel/HALKit/POWER/HalApplicationProcessor.cc +++ b/src/kernel/HALKit/POWER/HalApplicationProcessor.cc @@ -12,8 +12,7 @@ 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 520481d1..16c9e33f 100644 --- a/src/kernel/HALKit/RISCV/HalApplicationProcessor.cc +++ b/src/kernel/HALKit/RISCV/HalApplicationProcessor.cc @@ -13,8 +13,7 @@ using namespace Kernel; namespace Kernel {
namespace Detail {
STATIC void mp_hang_fn(void) {
- while (YES)
- ;
+ while (YES);
}
} // namespace Detail
|
