From 6f6211c5e6c2feb1706d9a3998dd029318c8a6c1 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 25 Sep 2022 15:11:28 +0300 Subject: [PATCH] Kernel: Simplify InterruptManagement::switch_to_pic_mode() Since switch_to_pic_mode is only called if no IOAPIC is available, there's no need to try and and find it and disable it. --- Kernel/Arch/x86/common/InterruptManagement.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Kernel/Arch/x86/common/InterruptManagement.cpp b/Kernel/Arch/x86/common/InterruptManagement.cpp index d9f0dfbb15..95769ad37b 100644 --- a/Kernel/Arch/x86/common/InterruptManagement.cpp +++ b/Kernel/Arch/x86/common/InterruptManagement.cpp @@ -138,20 +138,13 @@ UNMAP_AFTER_INIT InterruptManagement::InterruptManagement() UNMAP_AFTER_INIT void InterruptManagement::switch_to_pic_mode() { + VERIFY(m_interrupt_controllers.is_empty()); dmesgln("Interrupts: Switch to Legacy PIC mode"); InterruptDisabler disabler; m_interrupt_controllers.append(adopt_lock_ref(*new PIC())); SpuriousInterruptHandler::initialize(7); SpuriousInterruptHandler::initialize(15); - for (auto& irq_controller : m_interrupt_controllers) { - VERIFY(irq_controller); - if (irq_controller->type() == IRQControllerType::i82093AA) { - irq_controller->hard_disable(); - dbgln("Interrupts: Detected {} - Disabled", irq_controller->model()); - } else { - dbgln("Interrupts: Detected {}", irq_controller->model()); - } - } + dbgln("Interrupts: Detected {}", m_interrupt_controllers[0]->model()); } UNMAP_AFTER_INIT void InterruptManagement::switch_to_ioapic_mode()