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.
This commit is contained in:
Idan Horowitz 2022-09-25 15:11:28 +03:00
parent 9abbeff79f
commit 6f6211c5e6
Notes: sideshowbarker 2024-07-17 06:38:42 +09:00

View file

@ -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()