From 2eff368dd03c93a503e13ab82cf4c4abb0c06aa9 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 1 Mar 2006 05:26:08 -0500 Subject: Cleaned up some of the Fault system. arch/alpha/ev5.cc: Commented out the intr_post function since it's not used. If this really -is- needed, it should be moved into the fault class. arch/alpha/faults.cc: arch/alpha/faults.hh: Moved the fault invocation code into the fault class fully, and got rid of the need for isA. cpu/exec_context.cc: cpu/exec_context.hh: Removed the trap function from the ExecContext. The faults will execute normally in full system mode, but always panic in syscall emulation mode. cpu/ozone/cpu.hh: cpu/simple/cpu.hh: Changed the execution context executing a fault to a fault executing on the execution context. sim/faults.cc: If not in full system mode, trying to invoke a fault causes a panic. sim/faults.hh: Removed the isA function. --HG-- extra : convert_revision : 894dc8f0755c8efc4b7ef5a09fb2cf7373042395 --- sim/faults.cc | 7 +++++++ sim/faults.hh | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'sim') diff --git a/sim/faults.cc b/sim/faults.cc index 78bfc8092..68df2b785 100644 --- a/sim/faults.cc +++ b/sim/faults.cc @@ -27,7 +27,14 @@ */ #include "sim/faults.hh" +#include "cpu/exec_context.hh" FaultName MachineCheckFault::_name = "mchk"; FaultName AlignmentFault::_name = "unalign"; +#if !FULL_SYSTEM +void FaultBase::invoke(ExecContext * xc) +{ + fatal("fault (%s) detected @ PC 0x%08p", name(), xc->readPC()); +} +#endif diff --git a/sim/faults.hh b/sim/faults.hh index 6a786fe26..1e43bfb82 100644 --- a/sim/faults.hh +++ b/sim/faults.hh @@ -54,9 +54,11 @@ class FaultBase : public RefCounted virtual FaultStat & stat() = 0; #if FULL_SYSTEM virtual void invoke(ExecContext * xc) = 0; +#else + virtual void invoke(ExecContext * xc); #endif - template - bool isA() {return dynamic_cast(this);} +// template +// bool isA() {return dynamic_cast(this);} virtual bool isMachineCheckFault() {return false;} virtual bool isAlignmentFault() {return false;} }; -- cgit v1.2.3