From 83a1b826a3d838c034711b999a6dc938293a499d Mon Sep 17 00:00:00 2001 From: Reto Buerki Date: Fri, 27 Feb 2015 14:10:50 +0100 Subject: [PATCH] hw_x86_64: Add supervisor call handling to Thread::exception Forward supervisor calls to the Thread::_call function for dispatching. --- .../src/core/spec/x86/kernel/thread.cc | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 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 e4ff7ca09..841ff59ef 100644 --- a/repos/base-hw/src/core/spec/x86/kernel/thread.cc +++ b/repos/base-hw/src/core/spec/x86/kernel/thread.cc @@ -15,16 +15,27 @@ /* core includes */ #include -using namespace Kernel; +enum Cpu_exception { + SUPERVISOR_CALL = 0x80, +}; +using namespace Kernel; Thread::Thread(unsigned const priority, unsigned const quota, char const * const label) : Thread_base(this), Cpu_job(priority, quota), _state(AWAITS_START), _pd(0), - _utcb_phys(0), _signal_receiver(0), _label(label) -{ PDBG("not implemented"); } + _utcb_phys(0), _signal_receiver(0), _label(label) {} -void Thread::exception(unsigned const cpu) { - PDBG("not implemented"); } +void Thread::exception(unsigned const cpu) +{ + if (trapno == SUPERVISOR_CALL) { + _call(); + return; + } else { + PWRN("unknown exception 0x%lx", trapno); + _stop(); + return; + } +}