CPU: If the simple CPU is already idle, just return from suspendContext, don't assert.
authorGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 09:23:29 +0000 (02:23 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sun, 19 Apr 2009 09:23:29 +0000 (02:23 -0700)
src/cpu/simple/atomic.cc
src/cpu/simple/timing.cc

index 6011115887240da2e3edf0ff77c22a8f28f9f11a..3ce0ba172344cb2051d2dd24f0ead25a0c8ab5a1 100644 (file)
@@ -271,6 +271,9 @@ AtomicSimpleCPU::suspendContext(int thread_num)
     assert(thread_num == 0);
     assert(thread);
 
+    if (_status == Idle)
+        return;
+
     assert(_status == Running);
 
     // tick event may not be scheduled if this gets called from inside
index 1af2ea0ec0606c0f772780235819458d039cb1bc..64c4108a7c7084659eb48c04dc5e4b74adcbfa46 100644 (file)
@@ -233,6 +233,9 @@ TimingSimpleCPU::suspendContext(int thread_num)
     assert(thread_num == 0);
     assert(thread);
 
+    if (_status == Idle)
+        return;
+
     assert(_status == Running);
 
     // just change status to Idle... if status != Running,