template <> FaultVals MipsFault<MachineCheckFault>::vals =
{ "Machine Check", 0x0401 };
-template <> FaultVals MipsFault<AlignmentFault>::vals =
- { "Alignment", 0x0301 };
-
template <> FaultVals MipsFault<ResetFault>::vals =
#if FULL_SYSTEM
{ "Reset Fault", 0xBFC00000};
template <> FaultVals MipsFault<ThreadFault>::vals =
{ "Thread Fault", 0x00F1 };
-template <> FaultVals MipsFault<ArithmeticFault>::vals =
- { "Arithmetic Overflow Exception", 0x180 };
-
-template <> FaultVals MipsFault<UnimplementedOpcodeFault>::vals =
- { "opdec", 0x0481 };
+template <> FaultVals MipsFault<IntegerOverflowFault>::vals =
+ { "Integer Overflow Exception", 0x180 };
template <> FaultVals MipsFault<InterruptFault>::vals =
{ "interrupt", 0x0180 };
template <> FaultVals MipsFault<ItbInvalidFault>::vals =
{ "Invalid TLB Entry Exception (I-Fetch/LW)", 0x0180 };
-template <> FaultVals MipsFault<ItbPageFault>::vals =
- { "itbmiss", 0x0181 };
-
-template <> FaultVals MipsFault<ItbMissFault>::vals =
- { "itbmiss", 0x0181 };
-
-template <> FaultVals MipsFault<ItbAcvFault>::vals =
- { "iaccvio", 0x0081 };
-
template <> FaultVals MipsFault<ItbRefillFault>::vals =
{ "TLB Refill Exception (I-Fetch/LW)", 0x0180 };
-template <> FaultVals MipsFault<NDtbMissFault>::vals =
- { "dtb_miss_single", 0x0201 };
-
-template <> FaultVals MipsFault<PDtbMissFault>::vals =
- { "dtb_miss_double", 0x0281 };
-
-template <> FaultVals MipsFault<DtbPageFault>::vals =
- { "dfault", 0x0381 };
-
-template <> FaultVals MipsFault<DtbAcvFault>::vals =
- { "dfault", 0x0381 };
-
template <> FaultVals MipsFault<DtbInvalidFault>::vals =
{ "Invalid TLB Entry Exception (Store)", 0x0180 };
template <> FaultVals MipsFault<TLBModifiedFault>::vals =
{ "TLB Modified Exception", 0x0180 };
-template <> FaultVals MipsFault<FloatEnableFault>::vals =
- { "float_enable_fault", 0x0581 };
-
-template <> FaultVals MipsFault<IntegerOverflowFault>::vals =
- { "Integer Overflow Fault", 0x0501 };
-
template <> FaultVals MipsFault<DspStateDisabledFault>::vals =
{ "DSP Disabled Fault", 0x001a };
}
void
-ArithmeticFault::invoke(ThreadContext *tc, StaticInstPtr inst)
+IntegerOverflowFault::invoke(ThreadContext *tc, StaticInstPtr inst)
{
DPRINTF(MipsPRA, "%s encountered.\n", name());
setExceptionState(tc, 0xC);
bool isNonMaskableInterrupt() {return true;}
};
-class AlignmentFault : public MipsFault<AlignmentFault>
-{
- public:
- bool isAlignmentFault() {return true;}
-};
-
class AddressErrorFault : public MipsFault<AddressErrorFault>
{
public:
#endif
};
-class UnimplementedOpcodeFault : public MipsFault<UnimplementedOpcodeFault> {};
-
-class TLBRefillIFetchFault : public MipsFault<TLBRefillIFetchFault>
-{
- public:
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
-};
-
-class TLBInvalidIFetchFault : public MipsFault<TLBInvalidIFetchFault>
-{
- public:
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
-};
-
-class NDtbMissFault : public MipsFault<NDtbMissFault> {};
-class PDtbMissFault : public MipsFault<PDtbMissFault> {};
-class DtbPageFault : public MipsFault<DtbPageFault> {};
-class DtbAcvFault : public MipsFault<DtbAcvFault> {};
-
static inline Fault genMachineCheckFault()
{
return new MachineCheckFault;
}
-static inline Fault genAlignmentFault()
-{
- return new AlignmentFault;
-}
-
class ResetFault : public MipsFault<ResetFault>
{
public:
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
};
-class DebugSingleStep : public MipsFault<DebugSingleStep>
-{
- public:
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
-};
-
-class DebugInterrupt : public MipsFault<DebugInterrupt>
-{
- public:
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
-};
-
class CoprocessorUnusableFault : public MipsFault<CoprocessorUnusableFault>
{
protected:
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
};
-class ArithmeticFault : public MipsFault<ArithmeticFault>
+class IntegerOverflowFault : public MipsFault<IntegerOverflowFault>
{
protected:
bool skipFaultingInstruction() {return true;}
#endif
};
-class ItbPageFault : public MipsFault<ItbPageFault>
-{
- public:
-#if FULL_SYSTEM
- void invoke(ThreadContext * tc,
- StaticInstPtr inst = StaticInst::nullStaticInstPtr);
-#endif
-};
-
class ItbInvalidFault : public MipsFault<ItbInvalidFault>
{
public:
#endif
};
-class FloatEnableFault : public MipsFault<FloatEnableFault> {};
-class ItbMissFault : public MipsFault<ItbMissFault> {};
-class ItbAcvFault : public MipsFault<ItbAcvFault> {};
-class IntegerOverflowFault : public MipsFault<IntegerOverflowFault> {};
-
class DspStateDisabledFault : public MipsFault<DspStateDisabledFault>
{
public:
Rd = result = Rs + Rt;
if (FULL_SYSTEM &&
findOverflow(32, result, Rs, Rt)) {
- fault = new ArithmeticFault();
+ fault = new IntegerOverflowFault();
}
}});
0x1: addu({{ Rd.sw = Rs.sw + Rt.sw;}});
Rd = result = Rs - Rt;
if (FULL_SYSTEM &&
findOverflow(32, result, Rs, ~Rt)) {
- fault = new ArithmeticFault();
+ fault = new IntegerOverflowFault();
}
}});
0x3: subu({{ Rd.sw = Rs.sw - Rt.sw; }});
Rt = result = Rs + imm;
if (FULL_SYSTEM &&
findOverflow(32, result, Rs, imm)) {
- fault = new ArithmeticFault();
+ fault = new IntegerOverflowFault();
}
}});
0x1: addiu({{ Rt.sw = Rs.sw + imm; }});
panic("attempt to execute unimplemented instruction '%s' "
"(inst 0x%08x, opcode 0x%x, binary:%s)", mnemonic, machInst, OPCODE,
inst2string(machInst));
- return new UnimplementedOpcodeFault;
+ return NoFault;
}
Fault
panic("attempt to execute unimplemented instruction '%s' "
"(inst %#08x, opcode %#x, binary:%s)",
mnemonic, machInst, OPCODE, inst2string(machInst));
- return new UnimplementedOpcodeFault;
+ return NoFault;
}
}
panic("attempt to execute unimplemented instruction '%s' "
"(inst %#08x, opcode %#x, binary:%s)",
mnemonic, machInst, OPCODE, inst2string(machInst));
- return new UnimplementedOpcodeFault;
+ return NoFault;
}
}
panic("attempt to execute unimplemented instruction '%s' "
"(inst %#08x, opcode %#x, binary:%s)",
mnemonic, machInst, OPCODE, inst2string(machInst));
- return new UnimplementedOpcodeFault;
+ return NoFault;
}
}
if (req->getVaddr() & (req->getSize() - 1)) {
DPRINTF(TLB, "Alignment Fault on %#x, size = %d", req->getVaddr(),
req->getSize());
- return new AlignmentFault();
+ if (write)
+ return new StoreAddressErrorFault(req->getVaddr());
+ else
+ return new AddressErrorFault(req->getVaddr());
}