Kernel: Simplify interrupt management

The IRQController object is RefCounted, and is shared between the
InterruptManagement class & IRQ handlers' classes.

IRQHandler, SharedIRQHandler & SpuriousInterruptHandler classes
use a responsible IRQ controller directly instead of calling
InterruptManagement for disable(), enable() or eoi().

Also, the initialization process of InterruptManagement is
simplified, so it doesn't rely on an ACPI parser to be initialized.
This commit is contained in:
Liav A 2020-02-28 22:33:41 +02:00 committed by Andreas Kling
commit 6f914ed0a4
Notes: sideshowbarker 2024-07-19 08:58:25 +09:00
9 changed files with 80 additions and 128 deletions

View file

@ -26,10 +26,12 @@
#pragma once
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <AK/Types.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/Interrupts/GenericInterruptHandler.h>
#include <Kernel/Interrupts/IRQController.h>
namespace Kernel {
@ -53,11 +55,12 @@ public:
protected:
void change_irq_number(u8 irq);
explicit IRQHandler(u8 irq);
IRQHandler(u8 irq);
private:
bool m_shared_with_others { false };
bool m_enabled { false };
RefPtr<IRQController> m_responsible_irq_controller;
};
}