summaryrefslogtreecommitdiff
path: root/src/cpu/simple_thread.cc
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-07-06 23:13:38 -0400
committerKevin Lim <ktlim@umich.edu>2006-07-06 23:13:38 -0400
commitfff75316771331ec3247cbd6e424a93b252a1e29 (patch)
tree0e2e96841ebd160ef0160dd3dc56aa0a56696b86 /src/cpu/simple_thread.cc
parentfbe3e22474184e537fe74f4e86277056026f0514 (diff)
downloadgem5-fff75316771331ec3247cbd6e424a93b252a1e29.tar.xz
Support serializing and unserializing in the O3 CPU. Also a few small fixes for draining/switching CPUs.
src/cpu/o3/commit_impl.hh: Fix to clear drainPending variable on call to resume. src/cpu/o3/cpu.cc: src/cpu/o3/cpu.hh: Support serializing and unserializing in the O3 CPU. src/cpu/o3/lsq_impl.hh: Be sure to say we have no stores to write back if the active thread list is empty. src/cpu/simple_thread.cc: src/cpu/simple_thread.hh: Slightly change how SimpleThread is used to copy from other ThreadContexts. --HG-- extra : convert_revision : 92a5109b3783a989d5b451036061ef82c56d3121
Diffstat (limited to 'src/cpu/simple_thread.cc')
-rw-r--r--src/cpu/simple_thread.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/cpu/simple_thread.cc b/src/cpu/simple_thread.cc
index 6255b3357..af1db2ff2 100644
--- a/src/cpu/simple_thread.cc
+++ b/src/cpu/simple_thread.cc
@@ -125,7 +125,7 @@ SimpleThread::SimpleThread(BaseCPU *_cpu, int _thread_num,
#endif
-SimpleThread::SimpleThread(ThreadContext *oldContext)
+SimpleThread::SimpleThread()
#if FULL_SYSTEM
: ThreadState(-1, -1)
#else
@@ -134,19 +134,6 @@ SimpleThread::SimpleThread(ThreadContext *oldContext)
{
tc = new ProxyThreadContext<SimpleThread>(this);
regs.clear();
-
- copyState(oldContext);
-
-#if FULL_SYSTEM
- EndQuiesceEvent *quiesce = oldContext->getQuiesceEvent();
- if (quiesce) {
- quiesceEvent = quiesce;
- }
- Kernel::Statistics *stats = oldContext->getKernelStats();
- if (stats) {
- kernelStats = stats;
- }
-#endif
}
SimpleThread::~SimpleThread()
@@ -183,6 +170,23 @@ SimpleThread::takeOverFrom(ThreadContext *oldContext)
}
void
+SimpleThread::copyTC(ThreadContext *context)
+{
+ copyState(context);
+
+#if FULL_SYSTEM
+ EndQuiesceEvent *quiesce = context->getQuiesceEvent();
+ if (quiesce) {
+ quiesceEvent = quiesce;
+ }
+ Kernel::Statistics *stats = context->getKernelStats();
+ if (stats) {
+ kernelStats = stats;
+ }
+#endif
+}
+
+void
SimpleThread::copyState(ThreadContext *oldContext)
{
// copy over functional state