From 07cd7e966e6ee6715345b2f6ed2d4ea849fc7a36 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 27 Feb 2006 04:02:45 -0500 Subject: Added isMachineCheckFault and isAlignmentFault virtual functions to the fault base class, and replaced the isA templated function with them where appropriate. arch/alpha/ev5.cc: cpu/simple/cpu.cc: Changed from the isA templated function to isMachineCheckFault and isAlignmentFault sim/faults.hh: Added isMachineCheckFault and isAlignmentFault virtual functions to the fault base class. --HG-- extra : convert_revision : 3bf3a4369bc24a039648ee4f2a9c1663362ff2e2 --- sim/faults.hh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'sim') diff --git a/sim/faults.hh b/sim/faults.hh index ea2e21a7d..e4880f820 100644 --- a/sim/faults.hh +++ b/sim/faults.hh @@ -55,9 +55,17 @@ class FaultBase : public RefCounted virtual FaultStat & stat() = 0; template bool isA() {return dynamic_cast(this);} + virtual bool isMachineCheckFault() {return false;} + virtual bool isAlignmentFault() {return false;} }; -static FaultBase * const NoFault __attribute__ ((unused)) = 0; +FaultBase * const NoFault = 0; + +//The ISAs are each responsible for providing a genMachineCheckFault and a +//genAlignmentFault functions, which return faults to use in the case of a +//machine check fault or an alignment fault, respectively. Base classes which +//provide the name() function, and the isMachineCheckFault and isAlignmentFault +//functions are provided below. class MachineCheckFault : public FaultBase { @@ -67,6 +75,7 @@ class MachineCheckFault : public FaultBase public: FaultName name() {return _name;} FaultStat & stat() {return _stat;} + bool isMachineCheckFault() {return true;} }; class AlignmentFault : public FaultBase @@ -77,6 +86,7 @@ class AlignmentFault : public FaultBase public: FaultName name() {return _name;} FaultStat & stat() {return _stat;} + bool isAlignmentFault() {return true;} }; -- cgit v1.2.3