mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Initialize Spurious IRQ handlers in switch_to_pic_mode()
This commit is contained in:
parent
86395810a9
commit
976562307a
Notes:
sideshowbarker
2024-07-19 08:58:39 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/976562307ac Pull-request: https://github.com/SerenityOS/serenity/pull/1323 Reviewed-by: https://github.com/awesomekling
1 changed files with 9 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <Kernel/Interrupts/IOAPIC.h>
|
||||
#include <Kernel/Interrupts/InterruptManagement.h>
|
||||
#include <Kernel/Interrupts/PIC.h>
|
||||
#include <Kernel/Interrupts/SpuriousInterruptHandler.h>
|
||||
#include <Kernel/VM/MemoryManager.h>
|
||||
|
||||
#define PCAT_COMPAT_FLAG 0x1
|
||||
|
@ -91,6 +92,10 @@ void InterruptManagement::disable(u8 interrupt_vector)
|
|||
|
||||
void InterruptManagement::eoi(u8 interrupt_vector)
|
||||
{
|
||||
if (m_interrupt_controllers.size() == 1 && m_interrupt_controllers[0]->type() == IRQControllerType::i8259) {
|
||||
m_interrupt_controllers[0]->eoi(interrupt_vector);
|
||||
return;
|
||||
}
|
||||
for (auto& irq_controller : InterruptManagement::the().m_interrupt_controllers) {
|
||||
ASSERT(irq_controller != nullptr);
|
||||
if (irq_controller->get_gsi_base() <= interrupt_vector)
|
||||
|
@ -109,6 +114,8 @@ IRQController& InterruptManagement::get_interrupt_controller(int index)
|
|||
void InterruptManagement::switch_to_pic_mode()
|
||||
{
|
||||
kprintf("Interrupts: PIC mode by default\n");
|
||||
SpuriousInterruptHandler::initialize(7);
|
||||
SpuriousInterruptHandler::initialize(15);
|
||||
}
|
||||
|
||||
void InterruptManagement::switch_to_ioapic_mode()
|
||||
|
@ -135,6 +142,8 @@ AdvancedInterruptManagement::AdvancedInterruptManagement(PhysicalAddress p_madt)
|
|||
void AdvancedInterruptManagement::switch_to_pic_mode()
|
||||
{
|
||||
kprintf("Interrupts: Switch to Legacy PIC mode\n");
|
||||
SpuriousInterruptHandler::initialize(7);
|
||||
SpuriousInterruptHandler::initialize(15);
|
||||
for (auto& irq_controller : m_interrupt_controllers) {
|
||||
ASSERT(irq_controller);
|
||||
if (irq_controller->type() == IRQControllerType::i82093AA) {
|
||||
|
|
Loading…
Reference in a new issue