ladybird/Kernel/IRQHandler.cpp
Andreas Kling a9ca75c98b Add IRQHandler class that can be subclasses to handle an IRQ.
Also move Keyboard to a class implementation using this pattern.
2018-10-22 12:58:29 +02:00

26 lines
372 B
C++

#include "IRQHandler.h"
#include "i386.h"
#include "PIC.h"
IRQHandler::IRQHandler(byte irq)
: m_irqNumber(irq)
{
registerIRQHandler(m_irqNumber, *this);
}
IRQHandler::~IRQHandler()
{
unregisterIRQHandler(m_irqNumber, *this);
}
void IRQHandler::enableIRQ()
{
PIC::enable(m_irqNumber);
}
void IRQHandler::disableIRQ()
{
PIC::disable(m_irqNumber);
}