1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:57:45 +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:
Liav A 2021-06-05 09:00:18 +03:00 committed by Andreas Kling
parent 7a6d5a7b8b
commit b91df26d4a
43 changed files with 125 additions and 71 deletions

View file

@ -70,7 +70,7 @@ public:
handler->register_interrupt_handler();
}
virtual void handle_interrupt(const RegisterState&) override;
virtual bool handle_interrupt(const RegisterState&) override;
virtual bool eoi() override;
@ -101,7 +101,7 @@ public:
handler->register_interrupt_handler();
}
virtual void handle_interrupt(const RegisterState&) override;
virtual bool handle_interrupt(const RegisterState&) override;
virtual bool eoi() override;
@ -555,9 +555,10 @@ u32 APIC::get_timer_divisor()
return 16;
}
void APICIPIInterruptHandler::handle_interrupt(const RegisterState&)
bool APICIPIInterruptHandler::handle_interrupt(const RegisterState&)
{
dbgln_if(APIC_SMP_DEBUG, "APIC IPI on CPU #{}", Processor::id());
return true;
}
bool APICIPIInterruptHandler::eoi()
@ -567,9 +568,10 @@ bool APICIPIInterruptHandler::eoi()
return true;
}
void APICErrInterruptHandler::handle_interrupt(const RegisterState&)
bool APICErrInterruptHandler::handle_interrupt(const RegisterState&)
{
dbgln("APIC: SMP error on CPU #{}", Processor::id());
return true;
}
bool APICErrInterruptHandler::eoi()