Include ability to copy all misc regs.
arch/alpha/ev5.cc: Include function for the MiscRegFile to copy all of the Iprs from an ExecContext. arch/alpha/isa_traits.hh: Include functions to copy MiscRegs from an ExecContext. cpu/cpu_exec_context.cc: Be sure to copy all of the misc regs when copying all architectural state. --HG-- extra : convert_revision : cb948b5ff141ea0f739a1016f98236bd2a512f76
This commit is contained in:
parent
67732a7b28
commit
77e40756b7
3 changed files with 13 additions and 9 deletions
|
@ -541,6 +541,14 @@ AlphaISA::MiscRegFile::setIpr(int idx, uint64_t val, ExecContext *xc)
|
|||
return NoFault;
|
||||
}
|
||||
|
||||
void
|
||||
AlphaISA::MiscRegFile::copyIprs(ExecContext *xc)
|
||||
{
|
||||
for (int i = IPR_Base_DepTag; i < NumInternalProcRegs; ++i) {
|
||||
ipr[i] = xc->readMiscReg(i);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for special simulator handling of specific PAL calls.
|
||||
* If return value is false, actual PAL call will be suppressed.
|
||||
|
|
|
@ -169,6 +169,8 @@ extern const int reg_redir[NumIntRegs];
|
|||
Fault setRegWithEffect(int misc_reg, const MiscReg &val,
|
||||
ExecContext *xc);
|
||||
|
||||
void copyMiscRegs(ExecContext *xc);
|
||||
|
||||
#if FULL_SYSTEM
|
||||
protected:
|
||||
InternalProcReg ipr[NumInternalProcRegs]; // Internal processor regs
|
||||
|
@ -177,6 +179,8 @@ extern const int reg_redir[NumIntRegs];
|
|||
MiscReg readIpr(int idx, Fault &fault, ExecContext *xc);
|
||||
|
||||
Fault setIpr(int idx, uint64_t val, ExecContext *xc);
|
||||
|
||||
void copyIprs(ExecContext *xc);
|
||||
#endif
|
||||
friend class RegFile;
|
||||
};
|
||||
|
|
|
@ -289,15 +289,7 @@ CPUExecContext::copyArchRegs(ExecContext *xc)
|
|||
}
|
||||
|
||||
// Copy misc. registers
|
||||
setMiscReg(AlphaISA::Fpcr_DepTag, xc->readMiscReg(AlphaISA::Fpcr_DepTag));
|
||||
setMiscReg(AlphaISA::Uniq_DepTag, xc->readMiscReg(AlphaISA::Uniq_DepTag));
|
||||
setMiscReg(AlphaISA::Lock_Flag_DepTag,
|
||||
xc->readMiscReg(AlphaISA::Lock_Flag_DepTag));
|
||||
setMiscReg(AlphaISA::Lock_Addr_DepTag,
|
||||
xc->readMiscReg(AlphaISA::Lock_Addr_DepTag));
|
||||
|
||||
// Also need to copy all the IPRs. Probably should just have a copy misc
|
||||
// regs function defined on the misc regs.
|
||||
regs.miscRegs.copyMiscRegs(xc);
|
||||
|
||||
// Lastly copy PC/NPC
|
||||
setPC(xc->readPC());
|
||||
|
|
Loading…
Reference in a new issue