summaryrefslogtreecommitdiff
path: root/arch/alpha
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-03-13 17:04:24 -0500
committerKevin Lim <ktlim@umich.edu>2006-03-13 17:04:24 -0500
commitf045b110cf1db6f9fc70589532b48d9cca339897 (patch)
treef24bb6de3d522153f09ead7f5864c79aecab6a97 /arch/alpha
parentaf975813e546b5a951d5e7108454946afd31e434 (diff)
downloadgem5-f045b110cf1db6f9fc70589532b48d9cca339897.tar.xz
Have a copyRegs function defined in the ISA that copies registers from one ExecContext to another ExecContext. This makes it easier for anything that needs to copy architected registers to do so in an ISA independent fashion.
arch/alpha/ev5.cc: copyIprs now copies from a source ExecContext to a destination ExecContext. arch/alpha/registerfile.hh: Have ISA specific functions to copy all architected registers from one ExecContext to another. cpu/cpu_exec_context.cc: Call the ISA in order to copy any architected registers. --HG-- extra : convert_revision : 056cc3b3a9f345535d5a57c6524b114bbd5ae3c8
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/ev5.cc4
-rw-r--r--arch/alpha/registerfile.hh12
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/alpha/ev5.cc b/arch/alpha/ev5.cc
index 019e83dd4..6d45edbff 100644
--- a/arch/alpha/ev5.cc
+++ b/arch/alpha/ev5.cc
@@ -542,10 +542,10 @@ AlphaISA::MiscRegFile::setIpr(int idx, uint64_t val, ExecContext *xc)
}
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));
}
}
diff --git a/arch/alpha/registerfile.hh b/arch/alpha/registerfile.hh
index c2fb56ec1..6bdab78f5 100644
--- a/arch/alpha/registerfile.hh
+++ b/arch/alpha/registerfile.hh
@@ -34,6 +34,7 @@
#include "sim/faults.hh"
class Checkpoint;
+class ExecContext;
namespace AlphaISA
{
@@ -67,8 +68,6 @@ namespace AlphaISA
Fault setRegWithEffect(int misc_reg, const MiscReg &val,
ExecContext *xc);
- void copyMiscRegs(ExecContext *xc);
-
#if FULL_SYSTEM
protected:
typedef uint64_t InternalProcReg;
@@ -79,8 +78,6 @@ namespace AlphaISA
InternalProcReg readIpr(int idx, Fault &fault, ExecContext *xc);
Fault setIpr(int idx, InternalProcReg val, ExecContext *xc);
-
- void copyIprs(ExecContext *xc);
#endif
friend class RegFile;
};
@@ -105,6 +102,13 @@ namespace AlphaISA
void unserialize(Checkpoint *cp, const std::string &section);
};
+ void copyRegs(ExecContext *src, ExecContext *dest);
+
+ void copyMiscRegs(ExecContext *src, ExecContext *dest);
+
+#if FULL_SYSTEM
+ void copyIprs(ExecContext *src, ExecContext *dest);
+#endif
} // namespace AlphaISA
#endif