From 2ecdf4f729b6f21eb97f14ca56b109f8cdb21557 Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 27 Feb 2015 16:51:33 +0100 Subject: [PATCH] hw_x86_64: Forward interrupts to _interrupt function Extend the Thread::exception function to forward external interrupts to the _interrupt function for processing. --- repos/base-hw/src/core/spec/x86/kernel/thread.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/repos/base-hw/src/core/spec/x86/kernel/thread.cc b/repos/base-hw/src/core/spec/x86/kernel/thread.cc index e810a5ecf..02bd6e216 100644 --- a/repos/base-hw/src/core/spec/x86/kernel/thread.cc +++ b/repos/base-hw/src/core/spec/x86/kernel/thread.cc @@ -16,8 +16,10 @@ #include enum Cpu_exception { - PAGE_FAULT = 0x0e, - SUPERVISOR_CALL = 0x80, + PAGE_FAULT = 0x0e, + SUPERVISOR_CALL = 0x80, + INTERRUPTS_START = 0x20, + INTERRUPTS_END = 0xff, }; using namespace Kernel; @@ -38,6 +40,9 @@ void Thread::exception(unsigned const cpu) if (trapno == SUPERVISOR_CALL) { _call(); return; + } else if (trapno >= INTERRUPTS_START && trapno <= INTERRUPTS_END) { + _interrupt(cpu); + return; } else { PWRN("unknown exception 0x%lx", trapno); _stop();