mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +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
|
@ -82,9 +82,11 @@ AHCIPortHandler::~AHCIPortHandler()
|
|||
{
|
||||
}
|
||||
|
||||
void AHCIPortHandler::handle_irq(const RegisterState&)
|
||||
bool AHCIPortHandler::handle_irq(const RegisterState&)
|
||||
{
|
||||
dbgln_if(AHCI_DEBUG, "AHCI Port Handler: IRQ received");
|
||||
if (m_pending_ports_interrupts.is_zeroed())
|
||||
return false;
|
||||
for (auto port_index : m_pending_ports_interrupts.to_vector()) {
|
||||
auto port = m_handled_ports.get(port_index);
|
||||
VERIFY(port.has_value());
|
||||
|
@ -93,6 +95,7 @@ void AHCIPortHandler::handle_irq(const RegisterState&)
|
|||
// We do this to clear the pending interrupt after we handled it.
|
||||
m_pending_ports_interrupts.set_at(port_index);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue