X86: Implement a "halt" microop.
--HG-- extra : convert_revision : 53a846a157e4dce42343b81901df1207738f62cd
This commit is contained in:
parent
7f37322532
commit
f69a463b4b
1 changed files with 39 additions and 0 deletions
|
@ -77,6 +77,25 @@ output header {{
|
||||||
std::string generateDisassembly(Addr pc,
|
std::string generateDisassembly(Addr pc,
|
||||||
const SymbolTable *symtab) const;
|
const SymbolTable *symtab) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class MicroHalt : public X86ISA::X86MicroopBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MicroHalt(ExtMachInst _machInst, const char * instMnem,
|
||||||
|
bool isMicro, bool isDelayed, bool isFirst, bool isLast) :
|
||||||
|
X86MicroopBase(_machInst, "halt", instMnem,
|
||||||
|
isMicro, isDelayed, isFirst, isLast, No_OpClass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MicroHalt(ExtMachInst _machInst, const char * instMnem) :
|
||||||
|
X86MicroopBase(_machInst, "halt", instMnem,
|
||||||
|
false, false, false, false, No_OpClass)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
%(BasicExecDeclare)s
|
||||||
|
};
|
||||||
}};
|
}};
|
||||||
|
|
||||||
def template MicroFaultDeclare {{
|
def template MicroFaultDeclare {{
|
||||||
|
@ -111,6 +130,16 @@ def template MicroFaultExecute {{
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
output exec {{
|
||||||
|
Fault
|
||||||
|
MicroHalt::execute(%(CPU_exec_context)s *xc,
|
||||||
|
Trace::InstRecord * traceData) const
|
||||||
|
{
|
||||||
|
xc->suspend();
|
||||||
|
return NoFault;
|
||||||
|
}
|
||||||
|
}};
|
||||||
|
|
||||||
output decoder {{
|
output decoder {{
|
||||||
inline MicroFaultBase::MicroFaultBase(
|
inline MicroFaultBase::MicroFaultBase(
|
||||||
ExtMachInst machInst, const char * instMnem,
|
ExtMachInst machInst, const char * instMnem,
|
||||||
|
@ -209,4 +238,14 @@ let {{
|
||||||
header_output += MicroFaultDeclare.subst(iop)
|
header_output += MicroFaultDeclare.subst(iop)
|
||||||
decoder_output += MicroFaultConstructor.subst(iop)
|
decoder_output += MicroFaultConstructor.subst(iop)
|
||||||
microopClasses["fault"] = Fault
|
microopClasses["fault"] = Fault
|
||||||
|
|
||||||
|
class Halt(X86Microop):
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def getAllocator(self, *microFlags):
|
||||||
|
return "new MicroHalt(machInst, mnemonic %(flags)s)" % \
|
||||||
|
self.microFlagsText(microFlags)
|
||||||
|
|
||||||
|
microopClasses["halt"] = Halt
|
||||||
}};
|
}};
|
||||||
|
|
Loading…
Reference in a new issue