summaryrefslogtreecommitdiff
path: root/arch/alpha/faults.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-02-24 01:51:45 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-02-24 01:51:45 -0500
commit08637efadc40a1003d68bba91dedb007fe10798c (patch)
tree49405fe5d18c7e120d926b4b95f4aeeda3ef9097 /arch/alpha/faults.hh
parenta5f8392d343d0799d6c7f687ab3d342709717510 (diff)
downloadgem5-08637efadc40a1003d68bba91dedb007fe10798c.tar.xz
Changed Fault from a FaultBase * to a RefCountingPtr, added "new"s where appropriate, and took away the constant examples of each fault which where for comparing to a fault to determine its type.
arch/alpha/alpha_memory.cc: arch/alpha/isa/decoder.isa: Added news where faults are created. arch/alpha/ev5.cc: Changed places where a fault was compared to a fault type to use isA rather than == arch/alpha/faults.cc: arch/alpha/faults.hh: Changed Fault to be a RefCountingPtr arch/alpha/isa/fp.isa: Added a new where a FloatEnableFault was created. arch/alpha/isa/unimp.isa: arch/alpha/isa/unknown.isa: Added a new where an UnimplementedFault is created. base/refcnt.hh: Added include of stddef.h for the NULL macro cpu/base_dyn_inst.cc: Added a new where an UnimplementedOpcodeFault is created. cpu/o3/alpha_cpu_impl.hh: Changed places where a fault was compared to a fault type to use isA rather than ==. Also changed fault->name to fault->name() cpu/o3/regfile.hh: Added new where UnimplementedOpcodeFaults are created. cpu/simple/cpu.cc: Changed places where a fault was compared to a fault type to use isA rather than ==. Also added a new where an Interrupt fault is created. dev/alpha_console.cc: Added news where MachineCheckFaults are created. dev/pcidev.hh: Added news where MachineCheckFaults are generated. dev/sinic.cc: Changed places where a fault was compared to a fault type to use isA rather than ==. Added news where MachineCheckFaults are created. Fixed a problem where m5.fast had unused variables. kern/kernel_stats.cc: Commented out where _faults is initialized. This statistic will probably be moved elsewhere in the future. kern/kernel_stats.hh: Commented out the declaration of _fault. when fault() is called, the fault increments its own stat. sim/faults.cc: sim/faults.hh: Changed Fault from a FaultBase * to a RefCountingPtr. --HG-- extra : convert_revision : b40ccfc42482d5a115e111dd897fa378d23c6c7d
Diffstat (limited to 'arch/alpha/faults.hh')
-rw-r--r--arch/alpha/faults.hh217
1 files changed, 139 insertions, 78 deletions
diff --git a/arch/alpha/faults.hh b/arch/alpha/faults.hh
index 3e25adc4e..bd5163a7d 100644
--- a/arch/alpha/faults.hh
+++ b/arch/alpha/faults.hh
@@ -30,131 +30,192 @@
#define __ALPHA_FAULTS_HH__
#include "sim/faults.hh"
-#include "arch/isa_traits.hh" //For the Addr type
+
+// The reasoning behind the name and vect functions is in sim/faults.hh
+
+typedef const Addr FaultVect;
class AlphaFault : public FaultBase
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- AlphaFault(char * newName, int newId, Addr newVect)
- : FaultBase(newName, newId), vect(newVect)
- {;}
-
- Addr vect;
+ FaultName name() {return _name;}
+ virtual FaultVect vect() {return _vect;}
+ virtual FaultStat & stat() {return _stat;}
};
-extern class ResetFaultType : public AlphaFault
+class ResetFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- ResetFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const ResetFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class ArithmeticFaultType : public AlphaFault
+class ArithmeticFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- ArithmeticFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const ArithmeticFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class InterruptFaultType : public AlphaFault
+class InterruptFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- InterruptFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const InterruptFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class NDtbMissFaultType : public AlphaFault
+class NDtbMissFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- NDtbMissFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const NDtbMissFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class PDtbMissFaultType : public AlphaFault
+class PDtbMissFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- PDtbMissFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const PDtbMissFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class DtbPageFaultType : public AlphaFault
+class DtbPageFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- DtbPageFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const DtbPageFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class DtbAcvFaultType : public AlphaFault
+class DtbAcvFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- DtbAcvFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const DtbAcvFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class ItbMissFaultType : public AlphaFault
+class ItbMissFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- ItbMissFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const ItbMissFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class ItbPageFaultType : public AlphaFault
+class ItbPageFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- ItbPageFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const ItbPageFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class ItbAcvFaultType : public AlphaFault
+class ItbAcvFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- ItbAcvFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const ItbAcvFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class UnimplementedOpcodeFaultType : public AlphaFault
+class UnimplementedOpcodeFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- UnimplementedOpcodeFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const UnimplementedOpcodeFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class FloatEnableFaultType : public AlphaFault
+class FloatEnableFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- FloatEnableFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const FloatEnableFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class PalFaultType : public AlphaFault
+class PalFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- PalFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const PalFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern class IntegerOverflowFaultType : public AlphaFault
+class IntegerOverflowFault : public AlphaFault
{
+ private:
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _stat;
public:
- IntegerOverflowFaultType(char * newName, int newId, Addr newVect)
- : AlphaFault(newName, newId, newVect)
- {;}
-} * const IntegerOverflowFault;
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & stat() {return _stat;}
+};
-extern Fault * ListOfFaults[];
-extern int NumFaults;
+//Fault * ListOfFaults[];
+//int NumFaults;
#endif // __FAULTS_HH__