From d10195b1a4d331f2db99161bd6ed546e6d3cd31d Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 19 Apr 2009 02:23:29 -0700 Subject: [PATCH] CPU: If the simple CPU is already idle, just return from suspendContext, don't assert. --- src/cpu/simple/atomic.cc | 3 +++ src/cpu/simple/timing.cc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 601111588..3ce0ba172 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -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 diff --git a/src/cpu/simple/timing.cc b/src/cpu/simple/timing.cc index 1af2ea0ec..64c4108a7 100644 --- a/src/cpu/simple/timing.cc +++ b/src/cpu/simple/timing.cc @@ -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, -- 2.30.2