mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
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:
parent
9abbeff79f
commit
6f6211c5e6
1 changed files with 2 additions and 9 deletions
|
@ -138,20 +138,13 @@ UNMAP_AFTER_INIT InterruptManagement::InterruptManagement()
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void InterruptManagement::switch_to_pic_mode()
|
UNMAP_AFTER_INIT void InterruptManagement::switch_to_pic_mode()
|
||||||
{
|
{
|
||||||
|
VERIFY(m_interrupt_controllers.is_empty());
|
||||||
dmesgln("Interrupts: Switch to Legacy PIC mode");
|
dmesgln("Interrupts: Switch to Legacy PIC mode");
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
m_interrupt_controllers.append(adopt_lock_ref(*new PIC()));
|
m_interrupt_controllers.append(adopt_lock_ref(*new PIC()));
|
||||||
SpuriousInterruptHandler::initialize(7);
|
SpuriousInterruptHandler::initialize(7);
|
||||||
SpuriousInterruptHandler::initialize(15);
|
SpuriousInterruptHandler::initialize(15);
|
||||||
for (auto& irq_controller : m_interrupt_controllers) {
|
dbgln("Interrupts: Detected {}", m_interrupt_controllers[0]->model());
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UNMAP_AFTER_INIT void InterruptManagement::switch_to_ioapic_mode()
|
UNMAP_AFTER_INIT void InterruptManagement::switch_to_ioapic_mode()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue