mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:47: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
|
@ -230,12 +230,15 @@ UNMAP_AFTER_INIT E1000NetworkAdapter::~E1000NetworkAdapter()
|
|||
{
|
||||
}
|
||||
|
||||
void E1000NetworkAdapter::handle_irq(const RegisterState&)
|
||||
bool E1000NetworkAdapter::handle_irq(const RegisterState&)
|
||||
{
|
||||
u32 status = in32(REG_INTERRUPT_CAUSE_READ);
|
||||
|
||||
m_entropy_source.add_random_event(status);
|
||||
|
||||
if (status == 0)
|
||||
return false;
|
||||
|
||||
if (status & INTERRUPT_LSC) {
|
||||
u32 flags = in32(REG_CTRL);
|
||||
out32(REG_CTRL, flags | ECTRL_SLU);
|
||||
|
@ -253,6 +256,7 @@ void E1000NetworkAdapter::handle_irq(const RegisterState&)
|
|||
m_wait_queue.wake_all();
|
||||
|
||||
out32(REG_INTERRUPT_CAUSE_READ, 0xffffffff);
|
||||
return true;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT void E1000NetworkAdapter::detect_eeprom()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue