diff options
Diffstat (limited to 'src/cpu')
-rw-r--r-- | src/cpu/static_inst.cc | 34 | ||||
-rw-r--r-- | src/cpu/static_inst.hh | 3 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/cpu/static_inst.cc b/src/cpu/static_inst.cc index d50c9f15d..cdcd93c58 100644 --- a/src/cpu/static_inst.cc +++ b/src/cpu/static_inst.cc @@ -35,7 +35,41 @@ #include "sim/core.hh" +namespace { + +static TheISA::ExtMachInst nopMachInst; + +class NopStaticInst : public StaticInst +{ + public: + NopStaticInst() : StaticInst("gem5 nop", nopMachInst, No_OpClass) + {} + + Fault + execute(ExecContext *xc, Trace::InstRecord *traceData) const override + { + return NoFault; + } + + void + advancePC(TheISA::PCState &pcState) const override + { + pcState.advance(); + } + + std::string + generateDisassembly(Addr pc, const SymbolTable *symtab) const override + { + return mnemonic; + } + + private: +}; + +} + StaticInstPtr StaticInst::nullStaticInstPtr; +StaticInstPtr StaticInst::nopStaticInstPtr = new NopStaticInst; using namespace std; diff --git a/src/cpu/static_inst.hh b/src/cpu/static_inst.hh index a4077e1d0..79f45d828 100644 --- a/src/cpu/static_inst.hh +++ b/src/cpu/static_inst.hh @@ -205,6 +205,9 @@ class StaticInst : public RefCounted, public StaticInstFlags /// Pointer to a statically allocated "null" instruction object. static StaticInstPtr nullStaticInstPtr; + /// Pointer to a statically allocated generic "nop" instruction object. + static StaticInstPtr nopStaticInstPtr; + /// The binary machine instruction. const ExtMachInst machInst; |