mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +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
|
@ -184,10 +184,13 @@ UNMAP_AFTER_INIT NE2000NetworkAdapter::~NE2000NetworkAdapter()
|
|||
{
|
||||
}
|
||||
|
||||
void NE2000NetworkAdapter::handle_irq(const RegisterState&)
|
||||
bool NE2000NetworkAdapter::handle_irq(const RegisterState&)
|
||||
{
|
||||
u8 status = in8(REG_RW_INTERRUPTSTATUS);
|
||||
dbgln_if(NE2000_DEBUG, "NE2000NetworkAdapter: Got interrupt, status={:#02x}", status);
|
||||
if (status == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (status & BIT_INTERRUPTMASK_PRX) {
|
||||
dbgln_if(NE2000_DEBUG, "NE2000NetworkAdapter: Interrupt for packet received");
|
||||
|
@ -223,6 +226,7 @@ void NE2000NetworkAdapter::handle_irq(const RegisterState&)
|
|||
m_wait_queue.wake_all();
|
||||
|
||||
out8(REG_RW_INTERRUPTSTATUS, status);
|
||||
return true;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT int NE2000NetworkAdapter::ram_test()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue