mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:27:35 +00:00
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.
This commit is contained in:
parent
3f98a67d75
commit
0b7fc525e1
5 changed files with 31 additions and 19 deletions
|
@ -45,7 +45,7 @@ public:
|
|||
virtual void disable(const GenericInterruptHandler&) = 0;
|
||||
virtual void hard_disable() { m_hard_disabled = true; }
|
||||
virtual bool is_vector_enabled(u8 number) const = 0;
|
||||
bool is_enabled() const { return m_enabled && !m_hard_disabled; }
|
||||
virtual bool is_enabled() const = 0;
|
||||
bool is_hard_disabled() const { return m_hard_disabled; }
|
||||
virtual void eoi(const GenericInterruptHandler&) const = 0;
|
||||
virtual void spurious_eoi(const GenericInterruptHandler&) const = 0;
|
||||
|
@ -59,7 +59,6 @@ public:
|
|||
protected:
|
||||
IRQController() {}
|
||||
virtual void initialize() = 0;
|
||||
bool m_enabled { false };
|
||||
bool m_hard_disabled { false };
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue