1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:27: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:
Andreas Kling 2018-10-22 12:58:29 +02:00
parent 8f941561b4
commit a9ca75c98b
8 changed files with 152 additions and 100 deletions

21
Kernel/IRQHandler.h Normal file
View 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 };
};