mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:57:34 +00:00
Add IRQHandler class that can be subclasses to handle an IRQ.
Also move Keyboard to a class implementation using this pattern.
This commit is contained in:
parent
8f941561b4
commit
a9ca75c98b
8 changed files with 152 additions and 100 deletions
21
Kernel/IRQHandler.h
Normal file
21
Kernel/IRQHandler.h
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
|
||||
class IRQHandler {
|
||||
public:
|
||||
virtual ~IRQHandler();
|
||||
virtual void handleIRQ() = 0;
|
||||
|
||||
byte irqNumber() const { return m_irqNumber; }
|
||||
|
||||
void enableIRQ();
|
||||
void disableIRQ();
|
||||
|
||||
protected:
|
||||
explicit IRQHandler(byte irq);
|
||||
|
||||
private:
|
||||
byte m_irqNumber { 0 };
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue