X86: Make unrecognized instructions behave better in x86.

This commit is contained in:
Gabe Black 2010-09-14 12:27:30 -07:00
parent 0dd1f7f01a
commit 0bbd88eb40
3 changed files with 13 additions and 2 deletions

View file

@ -269,6 +269,13 @@ namespace X86ISA
#else
void
InvalidOpcode::invoke(ThreadContext * tc, StaticInstPtr inst)
{
panic("Unrecognized/invalid instruction executed:\n %s",
inst->machInst);
}
void
PageFault::invoke(ThreadContext * tc, StaticInstPtr inst)
{

View file

@ -250,6 +250,11 @@ namespace X86ISA
InvalidOpcode() :
X86Fault("Invalid-Opcode", "#UD", 6)
{}
#if !FULL_SYSTEM
void invoke(ThreadContext * tc,
StaticInstPtr inst = StaticInst::nullStaticInstPtr);
#endif
};
class DeviceNotAvailable : public X86Fault

View file

@ -77,8 +77,7 @@ output exec {{
Fault Unknown::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
warn("No instructions are implemented for X86!\n");
return NoFault;
return new InvalidOpcode();
}
}};