Use functions to access XC.

cpu/exec_context.hh:
    Include readNextNPC function.
cpu/simple/cpu.cc:
    Use functions to set and access nextPC, nextNPC.

--HG--
extra : convert_revision : 22622b9c110e1d99cc9106a2a27c479579d7e1ad
This commit is contained in:
Kevin Lim 2006-03-09 15:10:55 -05:00
parent a3aae21d03
commit e30bce8f8e
2 changed files with 7 additions and 2 deletions

View file

@ -422,6 +422,11 @@ class ExecContext
regs.npc = val;
}
uint64_t readNextNPC()
{
return regs.nnpc;
}
void setNextNPC(uint64_t val)
{
regs.nnpc = val;

View file

@ -825,8 +825,8 @@ SimpleCPU::tick()
#else
// go to the next instruction
xc->regs.pc = xc->regs.npc;
xc->regs.npc = xc->regs.nnpc;
xc->regs.nnpc += sizeof(MachInst);
xc->setNextPC(xc->readNextNPC());
xc->setNextNPC(xc->readNextNPC() + sizeof(MachInst));
#endif
}