summaryrefslogtreecommitdiff
path: root/src/cpu/simple_thread.cc
diff options
context:
space:
mode:
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