summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-08-02 12:04:18 -0400
committerKevin Lim <ktlim@umich.edu>2006-08-02 12:04:18 -0400
commit8d220c5c1024bc80c4f1365bc4ef542480acaac5 (patch)
tree8eb57e25f6e7eb713561aa8a324f7a04b67c600c
parentdb6c908e0fe5c82d1c165d8582ed876445d20b3d (diff)
downloadgem5-8d220c5c1024bc80c4f1365bc4ef542480acaac5.tar.xz
Updates for registers and stuff.
arch/alpha/ev5.cc: Update for copying IPRs. arch/alpha/isa_traits.hh: Allow for misc register file to serialize. Also add some register copying code. cpu/cpu_exec_context.cc: Use ISA's function to copy registers. --HG-- extra : convert_revision : 09fa3b2b1b229cbf3a34f69354953da2607c2a8f
-rw-r--r--arch/alpha/ev5.cc6
-rw-r--r--arch/alpha/isa_traits.hh19
-rw-r--r--cpu/cpu_exec_context.cc2
3 files changed, 23 insertions, 4 deletions
diff --git a/arch/alpha/ev5.cc b/arch/alpha/ev5.cc
index f113a2767..907bea92c 100644
--- a/arch/alpha/ev5.cc
+++ b/arch/alpha/ev5.cc
@@ -547,14 +547,16 @@ AlphaISA::MiscRegFile::setIpr(int idx, uint64_t val, ExecContext *xc)
return NoFault;
}
+
void
-AlphaISA::MiscRegFile::copyIprs(ExecContext *xc)
+AlphaISA::copyIprs(ExecContext *src, ExecContext *dest)
{
for (int i = IPR_Base_DepTag; i < NumInternalProcRegs; ++i) {
- ipr[i] = xc->readMiscReg(i);
+ dest->setMiscReg(i, src->readMiscReg(i));
}
}
+
/**
* Check for special simulator handling of specific PAL calls.
* If return value is false, actual PAL call will be suppressed.
diff --git a/arch/alpha/isa_traits.hh b/arch/alpha/isa_traits.hh
index 878193881..515ec933b 100644
--- a/arch/alpha/isa_traits.hh
+++ b/arch/alpha/isa_traits.hh
@@ -212,7 +212,16 @@ extern const int reg_redir[NumIntRegs];
Fault setRegWithEffect(int misc_reg, const MiscReg &val,
ExecContext *xc);
- void copyMiscRegs(ExecContext *xc);
+ void serialize(std::ostream &os);
+
+ void unserialize(Checkpoint *cp, const std::string &section);
+
+ void clear()
+ {
+ fpcr = uniq = 0;
+ lock_flag = 0;
+ lock_addr = 0;
+ }
#if FULL_SYSTEM
protected:
@@ -361,6 +370,14 @@ extern const int reg_redir[NumIntRegs];
}
}
#endif
+
+ void copyRegs(ExecContext *src, ExecContext *dest);
+
+ void copyMiscRegs(ExecContext *src, ExecContext *dest);
+
+#if FULL_SYSTEM
+ void copyIprs(ExecContext *src, ExecContext *dest);
+#endif
};
static inline AlphaISA::ExtMachInst
diff --git a/cpu/cpu_exec_context.cc b/cpu/cpu_exec_context.cc
index e30295ef8..e28c34f88 100644
--- a/cpu/cpu_exec_context.cc
+++ b/cpu/cpu_exec_context.cc
@@ -306,7 +306,7 @@ CPUExecContext::copyArchRegs(ExecContext *xc)
}
// Copy misc. registers
- regs.miscRegs.copyMiscRegs(xc);
+ TheISA::copyMiscRegs(xc, proxy);
// Lastly copy PC/NPC
setPC(xc->readPC());