1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +00:00

Kernel: Abstract IRQ controller handling from Interrupt handlers

Now we don't send raw numbers, but we let the IRQController object to
figure out the correct IRQ number.
This helps in a situation when we have 2 or more IOAPICs, so if IOAPIC
1 is assigned for IRQs 0-23 and IOAPIC 2 is assigned for IRQs 24-47,
if an IRQHandler of IRQ 25 invokes disable() for example, it will call
his responsible IRQController (IOAPIC 2), and the IRQController will
subtract the IRQ number with his assigned offset, and the result is that
the second redirection entry in IOAPIC 2 will be masked.
This commit is contained in:
Liav A 2020-03-08 12:47:33 +02:00 committed by Andreas Kling
parent 666990fbcb
commit f86be46c98
11 changed files with 97 additions and 45 deletions

View file

@ -49,7 +49,7 @@ bool IRQHandler::eoi()
#endif
if (!m_shared_with_others) {
ASSERT(!m_responsible_irq_controller.is_null());
m_responsible_irq_controller->eoi(interrupt_number());
m_responsible_irq_controller->eoi(*this);
return true;
}
return false;
@ -61,7 +61,7 @@ void IRQHandler::enable_irq()
dbg() << "Enable IRQ " << interrupt_number();
#endif
if (!m_shared_with_others)
m_responsible_irq_controller->enable(interrupt_number());
m_responsible_irq_controller->enable(*this);
else
m_enabled = true;
}
@ -72,7 +72,7 @@ void IRQHandler::disable_irq()
dbg() << "Disable IRQ " << interrupt_number();
#endif
if (!m_shared_with_others)
m_responsible_irq_controller->disable(interrupt_number());
m_responsible_irq_controller->disable(*this);
else
m_enabled = false;
}