diff options
author | Liav A <liavalb@gmail.com> | 2020-03-21 09:33:58 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-24 16:15:33 +0100 |
commit | 0b7fc525e143fbe282466c0ca12360321854088e (patch) | |
tree | e669216632df4ff40645ffbcb4da28c60261f730 /Kernel/Interrupts/PIC.h | |
parent | 3f98a67d75dad311eabc98b2423201c533ed01ef (diff) | |
download | serenity-0b7fc525e143fbe282466c0ca12360321854088e.zip |
Interrupts: Simplify IRQ disabling & enabling in IRQController(s)
Instead of blindly setting masks, if we want to disable an IRQ and it's
already masked, we just return. The same happens if we want to enable an
IRQ and it's unmasked.
Diffstat (limited to 'Kernel/Interrupts/PIC.h')
-rw-r--r-- | Kernel/Interrupts/PIC.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Interrupts/PIC.h b/Kernel/Interrupts/PIC.h index 95b3cc7286..81a1c650d5 100644 --- a/Kernel/Interrupts/PIC.h +++ b/Kernel/Interrupts/PIC.h @@ -38,6 +38,7 @@ public: virtual void hard_disable() override; virtual void eoi(const GenericInterruptHandler&) const override; virtual bool is_vector_enabled(u8 number) const override; + virtual bool is_enabled() const override; virtual void spurious_eoi(const GenericInterruptHandler&) const override; virtual u16 get_isr() const override; virtual u16 get_irr() const override; @@ -47,6 +48,7 @@ public: virtual IRQControllerType type() const override { return IRQControllerType::i8259; } private: + u16 m_cached_irq_mask { 0xffff }; void eoi_interrupt(u8 irq) const; void enable_vector(u8 number); void remap(u8 offset); |