Changes to support automatic renaming of the shadow registers at decode time. This...
[gem5.git] / arch / alpha / faults.hh
index bd5163a7d1642e562d892676fe44ea300fe8c41e..156faa8fbe706d3f78564e09dd12272a0ccb5e1e 100644 (file)
 
 #include "sim/faults.hh"
 
-// The reasoning behind the name and vect functions is in sim/faults.hh
+// The design of the "name" and "vect" functions is in sim/faults.hh
+
+namespace AlphaISA
+{
 
 typedef const Addr FaultVect;
 
-class AlphaFault : public FaultBase
+class AlphaFault : public virtual FaultBase
+{
+  public:
+#if FULL_SYSTEM
+    void ev5_trap(ExecContext * xc);
+#endif
+    virtual FaultVect vect() = 0;
+};
+
+class AlphaMachineCheckFault :
+    public MachineCheckFault,
+    public AlphaFault
 {
   private:
-    static FaultName _name;
     static FaultVect _vect;
     static FaultStat _stat;
   public:
-    FaultName name() {return _name;}
-    virtual FaultVect vect() {return _vect;}
-    virtual FaultStat & stat() {return _stat;}
+#if FULL_SYSTEM
+    void ev5_trap(ExecContext * xc);
+#endif
+    FaultVect vect() {return _vect;}
+    FaultStat & stat() {return _stat;}
 };
 
+class AlphaAlignmentFault :
+    public AlignmentFault,
+    public AlphaFault
+{
+  private:
+    static FaultVect _vect;
+    static FaultStat _stat;
+  public:
+#if FULL_SYSTEM
+    void ev5_trap(ExecContext * xc);
+#endif
+    FaultVect vect() {return _vect;}
+    FaultStat & stat() {return _stat;}
+};
+
+static inline Fault genMachineCheckFault()
+{
+    return new AlphaMachineCheckFault;
+}
+
+static inline Fault genAlignmentFault()
+{
+    return new AlphaAlignmentFault;
+}
+
 class ResetFault : public AlphaFault
 {
   private:
@@ -215,7 +255,6 @@ class IntegerOverflowFault : public AlphaFault
     FaultStat & stat() {return _stat;}
 };
 
-//Fault * ListOfFaults[];
-//int NumFaults;
+} // AlphaISA namespace
 
 #endif // __FAULTS_HH__