mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
Kernel/Interrupts: Return boolean on whether we handled the interrupt
If we are in a shared interrupt handler, the called handlers might indicate it was not their interrupt, so we should not increment the call counter of these handlers.
This commit is contained in:
parent
7a6d5a7b8b
commit
b91df26d4a
43 changed files with 125 additions and 71 deletions
|
@ -54,16 +54,19 @@ SpuriousInterruptHandler::~SpuriousInterruptHandler()
|
|||
{
|
||||
}
|
||||
|
||||
void SpuriousInterruptHandler::handle_interrupt(const RegisterState& state)
|
||||
bool SpuriousInterruptHandler::handle_interrupt(const RegisterState& state)
|
||||
{
|
||||
// Actually check if IRQ7 or IRQ15 are spurious, and if not, call the real handler to handle the IRQ.
|
||||
if (m_responsible_irq_controller->get_isr() & (1 << interrupt_number())) {
|
||||
m_real_irq = true; // remember that we had a real IRQ, when EOI later!
|
||||
m_real_handler->increment_invoking_counter();
|
||||
m_real_handler->handle_interrupt(state);
|
||||
return;
|
||||
if (m_real_handler->handle_interrupt(state)) {
|
||||
m_real_handler->increment_invoking_counter();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
dbgln("Spurious interrupt, vector {}", interrupt_number());
|
||||
return true;
|
||||
}
|
||||
|
||||
void SpuriousInterruptHandler::enable_interrupt_vector()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue