summaryrefslogtreecommitdiff
path: root/sim/faults.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-02-28 06:02:18 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-02-28 06:02:18 -0500
commit299efffaf5eb5fb55b2109a643e1e0e985f89ce6 (patch)
treea907d19867b35f26e11d9c9f5fe3b38e33853c2c /sim/faults.hh
parent6165419d356fb0cdbcb70d22dcd2f32e689eb7db (diff)
downloadgem5-299efffaf5eb5fb55b2109a643e1e0e985f89ce6.tar.xz
Cleaned up and slightly reorganized the Fault class heirarchy.
arch/alpha/ev5.cc: Changed c style casts of Faults to dynamic_casts arch/alpha/faults.cc: AlphaFault is now an abstract class. arch/alpha/faults.hh: AlphaFault is now an abstract class. Also, AlphaMachineCheckFault and AlphaAlignmentFault multiply inherit from both AlphaFault and from MachineCheckFault and AlignmentFault respectively. These classes get their name from the generic classes. cpu/o3/alpha_cpu_impl.hh: Changed a c style cast to a dynamic_cast for a Fault sim/faults.hh: All generic Fault classes are now abstract. Also, MachineCheckFault and AlignmentFault inherit FaultBase as a virtual base class to help resolve ambiguities when they are multiply inherited in ISA specific classes. The override the isMachineCheckFault and isAlignmentFault functions appropriately, and provide a standard name for these faults. --HG-- extra : convert_revision : 2cb906708e3eaec4a12587484c09e50ed6ef88fc
Diffstat (limited to 'sim/faults.hh')
-rw-r--r--sim/faults.hh9
1 files changed, 3 insertions, 6 deletions
diff --git a/sim/faults.hh b/sim/faults.hh
index 69e592485..9b8c94cda 100644
--- a/sim/faults.hh
+++ b/sim/faults.hh
@@ -50,10 +50,7 @@ typedef Stats::Scalar<> FaultStat;
class FaultBase : public RefCounted
{
public:
- virtual FaultName name()
- {
- return "none";
- }
+ virtual FaultName name() = 0;
virtual FaultStat & stat() = 0;
#if FULL_SYSTEM
virtual void ev5_trap(ExecContext * xc) = 0;
@@ -72,7 +69,7 @@ FaultBase * const NoFault = 0;
//provide the name() function, and the isMachineCheckFault and isAlignmentFault
//functions are provided below.
-class MachineCheckFault : public FaultBase
+class MachineCheckFault : public virtual FaultBase
{
private:
static FaultName _name;
@@ -81,7 +78,7 @@ class MachineCheckFault : public FaultBase
bool isMachineCheckFault() {return true;}
};
-class AlignmentFault : public FaultBase
+class AlignmentFault : public virtual FaultBase
{
private:
static FaultName _name;