#endif
-SimpleThread::SimpleThread(ThreadContext *oldContext)
+SimpleThread::SimpleThread()
#if FULL_SYSTEM
: ThreadState(-1, -1)
#else
{
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()
if (quiesceEvent) {
quiesceEvent->tc = tc;
}
+
+ Kernel::Statistics *stats = oldContext->getKernelStats();
+ if (stats) {
+ kernelStats = stats;
+ }
#endif
storeCondFailures = 0;
oldContext->setStatus(ThreadContext::Unallocated);
}
+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)
{
#if !FULL_SYSTEM
funcExeInst = oldContext->readFuncExeInst();
#endif
+ inst = oldContext->getInst();
}
void