diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 17:51:19 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-04-11 17:51:19 +0200 |
| commit | c3856eddb5a8146751dac82ad1ba4433f5ca6d6d (patch) | |
| tree | a74bdf6f87d07a24496effbc157f74d379d25007 /dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc | |
| parent | 9da6a352ecf70a1f5be99058a880b20db1b57940 (diff) | |
tweak kernel, boot: use -Wall, -Werror, -Wpedantic now.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc')
| -rw-r--r-- | dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc index 96276964..ddfc49b6 100644 --- a/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc +++ b/dev/kernel/HALKit/AMD64/HalDescriptorLoader.cc @@ -17,26 +17,8 @@ namespace Kernel::HAL STATIC ::Kernel::Detail::AMD64::InterruptDescriptorAMD64 kInterruptVectorTable[kKernelIdtSize] = {}; - STATIC void hal_set_irq_mask(UInt8 irql); - STATIC void hal_clear_irq_mask(UInt8 irql); - - STATIC Void hal_enable_pit(UInt16 ticks) noexcept - { - if (ticks == 0) - ticks = kPITDefaultTicks; - - // Configure PIT to receieve scheduler interrupts. - - UInt16 kPITCommDivisor = kPITFrequency / ticks; // 100 Hz. - - HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT - HAL::rt_out8(kPITChannel0Port, kPITCommDivisor & 0xFF); // Send low byte - HAL::rt_out8(kPITChannel0Port, (kPITCommDivisor >> 8) & 0xFF); // Send high byte - - hal_clear_irq_mask(32); - } - - STATIC void hal_set_irq_mask(UInt8 irql) +#if 0 + STATIC void hal_set_irq_mask(UInt8 irql) [[maybe_unused]] { UInt16 port; UInt8 value; @@ -54,8 +36,9 @@ namespace Kernel::HAL value = rt_in8(port) | (1 << irql); rt_out8(port, value); } +#endif // make gcc shut up - STATIC void hal_clear_irq_mask(UInt8 irql) + STATIC void hal_clear_irq_mask(UInt8 irql) [[maybe_unused]] { UInt16 port; UInt8 value; @@ -73,6 +56,22 @@ namespace Kernel::HAL value = rt_in8(port) & ~(1 << irql); rt_out8(port, value); } + + STATIC Void hal_enable_pit(UInt16 ticks) noexcept + { + if (ticks == 0) + ticks = kPITDefaultTicks; + + // Configure PIT to receieve scheduler interrupts. + + UInt16 kPITCommDivisor = kPITFrequency / ticks; // 100 Hz. + + HAL::rt_out8(kPITControlPort, 0x36); // Command to PIT + HAL::rt_out8(kPITChannel0Port, kPITCommDivisor & 0xFF); // Send low byte + HAL::rt_out8(kPITChannel0Port, (kPITCommDivisor >> 8) & 0xFF); // Send high byte + + hal_clear_irq_mask(32); + } } // namespace Detail /// @brief Loads the provided Global Descriptor Table. |
