o3, inorder: fix FS bug due to initializing ThreadState to Halted.
authorSteve Reinhardt <steve.reinhardt@amd.com>
Fri, 17 Apr 2009 23:54:58 +0000 (16:54 -0700)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Fri, 17 Apr 2009 23:54:58 +0000 (16:54 -0700)
For some reason o3 FS init() only called initCPU if the thread state
was Suspended, which was no longer the case.  There's no apparent
reason to check, so I whacked the test completely rather than
changing the check to Halted.
The inorder init() was also updated to be symmetric, though the
previous code was just a fancy no-op.

src/cpu/inorder/cpu.cc
src/cpu/o3/cpu.cc

index 9e3843e2042a698a8fccac67bc8c3e4b680a7f30..0b38f39bcf56649f13b10d678375f76e6bb27794 100644 (file)
@@ -29,6 +29,8 @@
  *
  */
 
+#include "config/full_system.hh"
+
 #include "arch/utility.hh"
 #include "cpu/exetrace.hh"
 #include "cpu/activity.hh"
@@ -420,16 +422,12 @@ InOrderCPU::init()
     for (int i = 0; i < number_of_threads; ++i)
         thread[i]->inSyscall = true;
 
+#if FULL_SYSTEM
     for (int tid=0; tid < number_of_threads; tid++) {
-
-        ThreadContext *src_tc = thread[tid]->getTC();
-
-        // Threads start in the Suspended State
-        if (src_tc->status() != ThreadContext::Suspended) {
-            continue;
-        }
-
+        ThreadContext *src_tc = threadContexts[tid];
+        TheISA::initCPU(src_tc, src_tc->contextId());
     }
+#endif
 
     // Clear inSyscall.
     for (int i = 0; i < number_of_threads; ++i)
index 83a012164211243b0fe8afb578669574a4a77299..038e5daaa037783b5facec14d76774d2520781e3 100644 (file)
@@ -568,21 +568,12 @@ FullO3CPU<Impl>::init()
     for (int i = 0; i < number_of_threads; ++i)
         thread[i]->inSyscall = true;
 
-    for (int tid=0; tid < number_of_threads; tid++) {
 #if FULL_SYSTEM
+    for (int tid=0; tid < number_of_threads; tid++) {
         ThreadContext *src_tc = threadContexts[tid];
-#else
-        ThreadContext *src_tc = thread[tid]->getTC();
-#endif
-        // Threads start in the Suspended State
-        if (src_tc->status() != ThreadContext::Suspended) {
-            continue;
-        }
-
-#if FULL_SYSTEM
         TheISA::initCPU(src_tc, src_tc->contextId());
-#endif
     }
+#endif
 
     // Clear inSyscall.
     for (int i = 0; i < number_of_threads; ++i)