summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/exec_context.hh6
-rw-r--r--cpu/simple/cpu.cc8
2 files changed, 14 insertions, 0 deletions
diff --git a/cpu/exec_context.hh b/cpu/exec_context.hh
index bc3551b4f..550a1ca23 100644
--- a/cpu/exec_context.hh
+++ b/cpu/exec_context.hh
@@ -422,6 +422,12 @@ class ExecContext
regs.npc = val;
}
+ void setNextNPC(uint64_t val)
+ {
+ regs.nnpc = val;
+ }
+
+
MiscReg readMiscReg(int misc_reg)
{
return regs.miscRegs.readReg(misc_reg);
diff --git a/cpu/simple/cpu.cc b/cpu/simple/cpu.cc
index 51d679a63..f1a3ebd0b 100644
--- a/cpu/simple/cpu.cc
+++ b/cpu/simple/cpu.cc
@@ -818,9 +818,17 @@ SimpleCPU::tick()
#endif // FULL_SYSTEM
}
else {
+#if THE_ISA != MIPS_ISA
// go to the next instruction
xc->regs.pc = xc->regs.npc;
xc->regs.npc += sizeof(MachInst);
+#else
+ // go to the next instruction
+ xc->regs.pc = xc->regs.npc;
+ xc->regs.npc = xc->regs.nnpc;
+ xc->regs.nnpc += sizeof(MachInst);
+#endif
+
}
#if FULL_SYSTEM