summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/faults.cc10
-rw-r--r--arch/mips/faults.hh20
-rw-r--r--arch/mips/isa/base.isa2
-rw-r--r--arch/mips/isa/includes.isa3
-rw-r--r--arch/sparc/faults.cc11
-rw-r--r--arch/sparc/faults.hh23
6 files changed, 66 insertions, 3 deletions
diff --git a/arch/mips/faults.cc b/arch/mips/faults.cc
index 1b31dfa69..a31856f07 100644
--- a/arch/mips/faults.cc
+++ b/arch/mips/faults.cc
@@ -98,6 +98,10 @@ FaultName IntegerOverflowFault::_name = "intover";
FaultVect IntegerOverflowFault::_vect = 0x0501;
FaultStat IntegerOverflowFault::_count;
+FaultName UnimpFault::_name = "Unimplemented Simulator feature";
+FaultVect UnimpFault::_vect = 0x0001;
+FaultStat UnimpFault::_count;
+
#if FULL_SYSTEM
void MipsFault::invoke(ExecContext * xc)
@@ -125,6 +129,12 @@ void ArithmeticFault::invoke(ExecContext * xc)
panic("Arithmetic traps are unimplemented!");
}
+void UnimpFault::invoke(ExecContext * xc)
+{
+ FaultBase::invoke(xc);
+ panic("Unimpfault: %s\n", panicStr.c_str());
+}
+
#endif
} // namespace MipsISA
diff --git a/arch/mips/faults.hh b/arch/mips/faults.hh
index 0bdabe29e..b0d228090 100644
--- a/arch/mips/faults.hh
+++ b/arch/mips/faults.hh
@@ -264,6 +264,26 @@ class IntegerOverflowFault : public MipsFault
FaultStat & countStat() {return _count;}
};
+class UnimpFault : public MipsFault
+{
+ private:
+ std::string panicStr;
+ static FaultName _name;
+ static FaultVect _vect;
+ static FaultStat _count;
+ public:
+ UnimpFault(std::string _str)
+ : panicStr(_str)
+ { }
+
+ FaultName name() {return _name;}
+ FaultVect vect() {return _vect;}
+ FaultStat & countStat() {return _count;}
+#if FULL_SYSTEM
+ void invoke(ExecContext * xc);
+#endif
+};
+
} // MipsISA namespace
#endif // __FAULTS_HH__
diff --git a/arch/mips/isa/base.isa b/arch/mips/isa/base.isa
index 139a6d876..9ed9651d2 100644
--- a/arch/mips/isa/base.isa
+++ b/arch/mips/isa/base.isa
@@ -9,8 +9,6 @@
output header {{
#define R31 31
-#include "arch/mips/faults.hh"
-#include "arch/mips/isa_traits.hh"
using namespace MipsISA;
diff --git a/arch/mips/isa/includes.isa b/arch/mips/isa/includes.isa
index b81c4eda2..9c370fbe3 100644
--- a/arch/mips/isa/includes.isa
+++ b/arch/mips/isa/includes.isa
@@ -17,6 +17,8 @@ output decoder {{
#include "base/cprintf.hh"
#include "base/loader/symtab.hh"
#include "cpu/exec_context.hh" // for Jump::branchTarget()
+#include "arch/mips/faults.hh"
+#include "arch/mips/isa_traits.hh"
#include <math.h>
#if defined(linux)
@@ -27,6 +29,7 @@ using namespace MipsISA;
}};
output exec {{
+#include "arch/mips/faults.hh"
#include "arch/mips/isa_traits.hh"
#include <math.h>
#if defined(linux)
diff --git a/arch/sparc/faults.cc b/arch/sparc/faults.cc
index 9831a7679..79ea7f54a 100644
--- a/arch/sparc/faults.cc
+++ b/arch/sparc/faults.cc
@@ -215,7 +215,10 @@ TrapType TrapInstruction::_baseTrapType = 0x100;
FaultPriority TrapInstruction::_priority = 16;
FaultStat TrapInstruction::_count;
-
+FaultName UnimpFault::_name = "Unimplemented Simulator feature";
+TrapType UnimpFault::_trapType = 0x000;
+FaultPriority UnimpFault::_priority = 0;
+FaultStat UnimpFault::_count;
#if FULL_SYSTEM
@@ -242,6 +245,12 @@ void SparcFault::invoke(ExecContext * xc)
xc->regs.npc = xc->regs.pc + sizeof(MachInst);*/
}
+void UnimpFault::invoke(ExecContext * xc)
+{
+ panic("Unimpfault: %s\n", panicStr.c_str());
+}
+
+
#endif
} // namespace SparcISA
diff --git a/arch/sparc/faults.hh b/arch/sparc/faults.hh
index 985407c26..62bffa72e 100644
--- a/arch/sparc/faults.hh
+++ b/arch/sparc/faults.hh
@@ -582,6 +582,29 @@ class TrapInstruction : public EnumeratedFault
FaultStat & countStat() {return _count;}
};
+class UnimpFault : public SparcFault
+{
+ private:
+ static FaultName _name;
+ static TrapType _trapType;
+ static FaultPriority _priority;
+ static FaultStat _count;
+ std::string panicStr;
+ public:
+ UnimpFault(std::string _str)
+ : panicStr(_str)
+ { }
+
+ FaultName name() {return _name;}
+ TrapType trapType() {return _trapType;}
+ FaultPriority priority() {return _priority;}
+ FaultStat & countStat() {return _count;}
+#if FULL_SYSTEM
+ void invoke(ExecContext * xc);
+#endif
+};
+
+
} // SparcISA namespace
#endif // __FAULTS_HH__