From 0692b9d618c9f04f23b8f3b96cb5229ad8c77c8c Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Tue, 20 Oct 2026 16:17:35 +0200 Subject: [PATCH] fix: irq manager handle controller Enable/disable hardware interrupts in the IRQ's controller through IRQ manager. --- kernel/arch/x86_64/arch.cpp | 2 -- kernel/arch/x86_64/int.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/arch/x86_64/arch.cpp b/kernel/arch/x86_64/arch.cpp index 700acc2..96bd38f 100644 --- a/kernel/arch/x86_64/arch.cpp +++ b/kernel/arch/x86_64/arch.cpp @@ -26,8 +26,6 @@ void arch::init() { static constexpr hwirq_t PIT_HWIRQ = 0x00; - m_picController.enable(PIT_HWIRQ); - irq_t pitIrq = m_irqManager.allocate(); m_irqManager.bind(pitIrq, m_picController, PIT_HWIRQ, 0x20); m_irqManager.register_handler(pitIrq, pit::handler, &m_pit); diff --git a/kernel/arch/x86_64/int.cpp b/kernel/arch/x86_64/int.cpp index a57bb98..cef10c4 100644 --- a/kernel/arch/x86_64/int.cpp +++ b/kernel/arch/x86_64/int.cpp @@ -64,6 +64,7 @@ bool irq_manager::enable(irq_t irq) { auto* entry = at(irq); if (entry == nullptr) return false; entry->enabled = true; + entry->controller->enable(entry->hwirq); return true; } @@ -71,6 +72,7 @@ bool irq_manager::disable(irq_t irq) { auto* entry = at(irq); if (entry == nullptr) return false; entry->enabled = false; + entry->controller->disable(entry->hwirq); return true; }