From 1f6ce53e085dedff560709c83ea67b57603ff1d2 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 13 Mar 2016 15:47:50 -0400 Subject: [PATCH] Add method to post an interrupt in software --- src/Interrupts.cc | 8 ++++++++ src/Interrupts.hh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/Interrupts.cc b/src/Interrupts.cc index 34d200a..66e0e89 100644 --- a/src/Interrupts.cc +++ b/src/Interrupts.cc @@ -79,6 +79,14 @@ InterruptHandler::disableInterrupts() asm("cli"); } + +void +InterruptHandler::postInterrupt(uint8_t interrupt) + const +{ + asm("int %0": : "a"(interrupt)); +} + } /* namespace x86 */ diff --git a/src/Interrupts.hh b/src/Interrupts.hh index b579981..94be2dd 100644 --- a/src/Interrupts.hh +++ b/src/Interrupts.hh @@ -55,6 +55,8 @@ struct InterruptHandler void enableInterrupts() const; void disableInterrupts() const; + void postInterrupt(uint8_t interrupt); + private: PIC mPIC; IDT mIDT;