From 2424ecaa302667a22321669a77bb7f54e90a3e13 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 13 Mar 2016 15:55:40 -0400 Subject: [PATCH] Send EOI to PIC when we're done with a hardware interrupt --- src/Interrupts.cc | 10 ++++++++++ src/Interrupts.hh | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/Interrupts.cc b/src/Interrupts.cc index 2b8f5fa..dac2141 100644 --- a/src/Interrupts.cc +++ b/src/Interrupts.cc @@ -89,6 +89,13 @@ InterruptHandler::postInterrupt(uint8_t interrupt) asm("int %0": : "a"(interrupt)); } + +void +InterruptHandler::finishHardwareInterrupt(uint8_t irq) +{ + mPIC.endOfInterrupt(irq); +} + } /* namespace x86 */ @@ -143,4 +150,7 @@ handleKeyboardInterrupt() { auto& console = kernel::Console::systemConsole(); console.printString("Key!\n"); + + auto& interruptHandler = x86::InterruptHandler::systemInterruptHandler(); + interruptHandler.finishHardwareInterrupt(1); } diff --git a/src/Interrupts.hh b/src/Interrupts.hh index 94be2dd..1829c64 100644 --- a/src/Interrupts.hh +++ b/src/Interrupts.hh @@ -57,6 +57,8 @@ struct InterruptHandler void postInterrupt(uint8_t interrupt); + void finishHardwareInterrupt(uint8_t irq); + private: PIC mPIC; IDT mIDT;