summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-02-27 04:02:45 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-02-27 04:02:45 -0500
commit07cd7e966e6ee6715345b2f6ed2d4ea849fc7a36 (patch)
tree0fc532ca76620495d20eeb4fd416176acf4954d9 /sim
parentf9c2b9e74fc459dc221035cb98e2a2e6a1540f9f (diff)
downloadgem5-07cd7e966e6ee6715345b2f6ed2d4ea849fc7a36.tar.xz
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
Diffstat (limited to 'sim')
-rw-r--r--sim/faults.hh12
1 files changed, 11 insertions, 1 deletions
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<typename T>
bool isA() {return dynamic_cast<T *>(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;}
};