From e0633b442140d49e08af6759bd07c89e16ef0e2a Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 5 Jan 2025 12:19:58 +0100 Subject: ADD: Ran format command and refactors too. Signed-off-by: Amlal El Mahrouss --- dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc | 10 +--------- dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc | 4 ++-- dev/Kernel/HALKit/AMD64/HalKernelMain.cc | 4 ++-- dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc | 4 ++-- dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc | 8 ++++---- 5 files changed, 11 insertions(+), 19 deletions(-) (limited to 'dev/Kernel/HALKit') diff --git a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc index ca3f2353..f97669c8 100644 --- a/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc +++ b/dev/Kernel/HALKit/AMD64/HalCoreInterruptHandlerAMD64.cc @@ -9,7 +9,7 @@ #include #include -STATIC BOOL kIsScheduling = NO; +STATIC BOOL kIsScheduling = NO; /// @brief Handle GPF fault. /// @param rsp @@ -58,8 +58,6 @@ EXTERN_C void idt_handle_pf(Kernel::UIntPtr rsp) process.Leak().Status = Kernel::ProcessStatusKind::kKilled; process.Leak().Crash(); - - } /// @brief Handle scheduler interrupt. @@ -106,8 +104,6 @@ EXTERN_C void idt_handle_math(Kernel::UIntPtr rsp) process.Leak().Status = Kernel::ProcessStatusKind::kKilled; process.Leak().Crash(); - - } /// @brief Handle any generic fault. @@ -132,8 +128,6 @@ EXTERN_C void idt_handle_generic(Kernel::UIntPtr rsp) process.Leak().Status = Kernel::ProcessStatusKind::kKilled; process.Leak().Crash(); - - } EXTERN_C Kernel::Void idt_handle_breakpoint(Kernel::UIntPtr rip) @@ -180,8 +174,6 @@ EXTERN_C void idt_handle_ud(Kernel::UIntPtr rsp) process.Leak().Status = Kernel::ProcessStatusKind::kKilled; process.Leak().Crash(); - - } /// @brief Enter syscall from assembly. diff --git a/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc b/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc index ed9bf15b..680aa6ed 100644 --- a/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc +++ b/dev/Kernel/HALKit/AMD64/HalDescriptorLoader.cc @@ -28,8 +28,8 @@ namespace Kernel::HAL UInt16 cCommDivisor = kPITFrequency / ticks; // 100 Hz. - HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT - HAL::rt_out8(kPITChannel0Port, cCommDivisor & 0xFF); // Send low byte + HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT + HAL::rt_out8(kPITChannel0Port, cCommDivisor & 0xFF); // Send low byte HAL::rt_out8(kPITChannel0Port, (cCommDivisor >> 8) & 0xFF); // Send high byte hal_clear_irq_mask(32); diff --git a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc index 56f8e1e5..b6ac0f3b 100644 --- a/dev/Kernel/HALKit/AMD64/HalKernelMain.cc +++ b/dev/Kernel/HALKit/AMD64/HalKernelMain.cc @@ -26,7 +26,7 @@ STATIC Kernel::Void hal_init_cxx_ctors() { for (Kernel::SizeT i = 0U; i < Kernel::UserProcessScheduler::The().CurrentTeam().AsArray().Count(); ++i) { - Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = Kernel::UserThread(); + Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i] = Kernel::UserThread(); Kernel::UserProcessScheduler::The().CurrentTeam().AsArray()[i].Status = Kernel::ProcessStatusKind::kKilled; } @@ -69,7 +69,7 @@ EXTERN_C void hal_init_platform( /* GDT, mostly descriptors for user and kernel segments. */ STATIC Kernel::HAL::Detail::ZKA_GDT_ENTRY ALIGN(0x08) kGDTArray[kGDTEntriesCount] = { - {.fLimitLow = 0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x00, .fFlags = 0x00, .fBaseHigh = 0}, // Null entry + {.fLimitLow = 0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x00, .fFlags = 0x00, .fBaseHigh = 0}, // Null entry {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x9A, .fFlags = 0xAF, .fBaseHigh = 0}, // Kernel code {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0x92, .fFlags = 0xCF, .fBaseHigh = 0}, // Kernel data {.fLimitLow = 0x0, .fBaseLow = 0, .fBaseMid = 0, .fAccessByte = 0xFA, .fFlags = 0xAF, .fBaseHigh = 0}, // User code diff --git a/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc b/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc index ea8840eb..9fc261ef 100644 --- a/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc +++ b/dev/Kernel/HALKit/AMD64/Storage/ATA-PIO.cc @@ -121,7 +121,7 @@ Void drv_std_read(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorSz 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); @@ -153,7 +153,7 @@ Void drv_std_write(UInt64 Lba, UInt16 IO, UInt8 Master, Char* Buf, SizeT SectorS 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); diff --git a/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc b/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc index 2d556b96..fc16a7e3 100644 --- a/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc +++ b/dev/Kernel/HALKit/ARM64/Storage/MFlash+IO.cc @@ -22,9 +22,9 @@ namespace Kernel constexpr auto kFlashBridgeMagic = "FLSH"; constexpr auto kFlashBridgeRevision = 1; - STATIC BOOL kFlashEnabled = NO; - STATIC SizeT kFlashSize[kMaxFlashSlots] = {}; - STATIC SizeT kFlashSectorSz[kMaxFlashSlots] = {}; + STATIC BOOL kFlashEnabled = NO; + STATIC SizeT kFlashSize[kMaxFlashSlots] = {}; + STATIC SizeT kFlashSectorSz[kMaxFlashSlots] = {}; STATIC IMBCIHost* kFlashMetaPackets[kMaxFlashSlots] = {}; STATIC IMBCIHost* kFlashDataPackets[kMaxFlashSlots] = {}; @@ -76,7 +76,7 @@ namespace Kernel kFlashMetaPackets[slot]->InterruptEnable = NO; kcout << "Disabled hardware slot at: " << number(slot) << endl; - + return YES; } } // namespace Kernel -- cgit v1.2.3