diff options
Diffstat (limited to 'sim')
-rw-r--r-- | sim/faults.cc | 7 | ||||
-rw-r--r-- | sim/faults.hh | 6 |
2 files changed, 11 insertions, 2 deletions
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<typename T> - bool isA() {return dynamic_cast<T *>(this);} +// template<typename T> +// bool isA() {return dynamic_cast<T *>(this);} virtual bool isMachineCheckFault() {return false;} virtual bool isAlignmentFault() {return false;} }; |