AtomicSimpleCPU: Refactor resume() code to have a cleaner control path.
--HG-- extra : convert_revision : f27bb96850e7fb0252fb1f47c3d0860705c32884
This commit is contained in:
parent
f4222610ea
commit
cf1c25dbcc
1 changed files with 9 additions and 8 deletions
|
@ -194,15 +194,16 @@ AtomicSimpleCPU::unserialize(Checkpoint *cp, const string §ion)
|
|||
void
|
||||
AtomicSimpleCPU::resume()
|
||||
{
|
||||
DPRINTF(SimpleCPU, "Resume\n");
|
||||
if (_status != SwitchedOut && _status != Idle) {
|
||||
assert(system->getMemoryMode() == Enums::atomic);
|
||||
if (_status == Idle || _status == SwitchedOut)
|
||||
return;
|
||||
|
||||
changeState(SimObject::Running);
|
||||
if (thread->status() == ThreadContext::Active) {
|
||||
if (!tickEvent.scheduled()) {
|
||||
tickEvent.schedule(nextCycle());
|
||||
}
|
||||
DPRINTF(SimpleCPU, "Resume\n");
|
||||
assert(system->getMemoryMode() == Enums::atomic);
|
||||
|
||||
changeState(SimObject::Running);
|
||||
if (thread->status() == ThreadContext::Active) {
|
||||
if (!tickEvent.scheduled()) {
|
||||
tickEvent.schedule(nextCycle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue