From: Ali Saidi Date: Thu, 8 Nov 2007 15:46:41 +0000 (-0500) Subject: AtomicSimpleCPU: Refactor resume() code to have a cleaner control path. X-Git-Tag: m5_2.0_beta5~96 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf1c25dbcc22e2baddb78592df515081c4800a65;p=gem5.git AtomicSimpleCPU: Refactor resume() code to have a cleaner control path. --HG-- extra : convert_revision : f27bb96850e7fb0252fb1f47c3d0860705c32884 --- diff --git a/src/cpu/simple/atomic.cc b/src/cpu/simple/atomic.cc index 4e52f9b33..9d7181cea 100644 --- a/src/cpu/simple/atomic.cc +++ b/src/cpu/simple/atomic.cc @@ -194,15 +194,16 @@ AtomicSimpleCPU::unserialize(Checkpoint *cp, const string §ion) void AtomicSimpleCPU::resume() { + if (_status == Idle || _status == SwitchedOut) + return; + DPRINTF(SimpleCPU, "Resume\n"); - if (_status != SwitchedOut && _status != Idle) { - assert(system->getMemoryMode() == Enums::atomic); + assert(system->getMemoryMode() == Enums::atomic); - changeState(SimObject::Running); - if (thread->status() == ThreadContext::Active) { - if (!tickEvent.scheduled()) { - tickEvent.schedule(nextCycle()); - } + changeState(SimObject::Running); + if (thread->status() == ThreadContext::Active) { + if (!tickEvent.scheduled()) { + tickEvent.schedule(nextCycle()); } } }