FaultVect IntegerOverflowFault::_vect = 0x0501;
FaultStat IntegerOverflowFault::_count;
-FaultName UnimpFault::_name = "Unimplemented Simulator feature";
-FaultVect UnimpFault::_vect = 0x0001;
-FaultStat UnimpFault::_count;
-
#if FULL_SYSTEM
void AlphaFault::invoke(ExecContext * xc)
AlphaFault::invoke(xc);
}
-void UnimpFault::invoke(ExecContext * xc)
-{
- FaultBase::invoke(xc);
- panic("Unimpfault: %s\n", panicStr.c_str());
-}
-
#endif
} // namespace AlphaISA
FaultStat & countStat() {return _count;}
};
-class UnimpFault : public AlphaFault
-{
- 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
-};
-
} // AlphaISA namespace
#endif // __FAULTS_HH__
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)
panic("Arithmetic traps are unimplemented!");
}
-void UnimpFault::invoke(ExecContext * xc)
-{
- FaultBase::invoke(xc);
- panic("Unimpfault: %s\n", panicStr.c_str());
-}
-
#endif
} // namespace MipsISA
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__
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
void SparcFault::invoke(ExecContext * xc)
xc->regs.npc = xc->regs.pc + sizeof(MachInst);*/
}
-void UnimpFault::invoke(ExecContext * xc)
+#endif
+
+#if !FULL_SYSTEM
+
+void TrapInstruction::invoke(ExecContext * xc)
{
- panic("Unimpfault: %s\n", panicStr.c_str());
+ xc->syscall(syscall_num);
}
-
#endif
} // namespace SparcISA
static TrapType _baseTrapType;
static FaultPriority _priority;
static FaultStat _count;
+ uint64_t syscall_num;
TrapType baseTrapType() {return _baseTrapType;}
public:
- TrapInstruction(uint32_t n) : EnumeratedFault(n) {;}
+ TrapInstruction(uint32_t n, uint64_t syscall) :
+ EnumeratedFault(n), syscall_num(syscall) {;}
FaultName name() {return _name;}
FaultPriority priority() {return _priority;}
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
+#if !FULL_SYSTEM
void invoke(ExecContext * xc);
#endif
};
-
} // SparcISA namespace
#endif // __FAULTS_HH__
assert(!xc->misspeculating());
}
#endif
+
+void UnimpFault::invoke(ExecContext * xc)
+{
+ panic("Unimpfault: %s\n", panicStr.c_str());
+}
FaultBase * const NoFault = 0;
+class UnimpFault : public FaultBase
+{
+ private:
+ std::string panicStr;
+ public:
+ UnimpFault(std::string _str)
+ : panicStr(_str)
+ { }
+
+ FaultName name() {return "Unimplemented simulator feature";}
+ void invoke(ExecContext * xc);
+};
+
#endif // __FAULTS_HH__