1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07: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

@ -586,13 +586,13 @@ void UHCIController::spawn_port_proc()
});
}
void UHCIController::handle_irq(const RegisterState&)
bool UHCIController::handle_irq(const RegisterState&)
{
u32 status = read_usbsts();
// Shared IRQ. Not ours!
if (!status)
return;
return false;
if constexpr (UHCI_DEBUG) {
dbgln("UHCI: Interrupt happened!");
@ -601,6 +601,7 @@ void UHCIController::handle_irq(const RegisterState&)
// Write back USBSTS to clear bits
write_usbsts(status);
return true;
}
}