summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-12-05 17:45:31 -0800
committerGabe Black <gabeblack@google.com>2018-12-10 06:42:23 +0000
commit3182b2adec05be519c3251bb775f0d8ddbb2ecdf (patch)
tree9557991bb33d42c8eecf94eed6b0c02f88d565ca
parentd051b9f1dae199087ed1991cfdb5dd01e4758294 (diff)
downloadgem5-3182b2adec05be519c3251bb775f0d8ddbb2ecdf.tar.xz
systemc: Ignore process control functions on terminated processes.
These functions can descend to the children of a terminated process, but should have no effect on that process itself. Change-Id: I6e4bdec8c492dd03d05bc1397aa080e8a51397c1 Reviewed-on: https://gem5-review.googlesource.com/c/14917 Reviewed-by: Matthias Jung <jungma@eit.uni-kl.de> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/systemc/core/process.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 193056f67..aaa42e8eb 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -81,7 +81,7 @@ Process::suspend(bool inc_kids)
if (inc_kids)
forEachKid([](Process *p) { p->suspend(true); });
- if (!_suspended) {
+ if (!_suspended && !_terminated) {
_suspended = true;
_suspendedReady = scheduler.suspend(this);
@@ -102,7 +102,7 @@ Process::resume(bool inc_kids)
if (inc_kids)
forEachKid([](Process *p) { p->resume(true); });
- if (_suspended) {
+ if (_suspended && !_terminated) {
_suspended = false;
if (_suspendedReady)
scheduler.resume(this);
@@ -124,7 +124,8 @@ Process::disable(bool inc_kids)
message.c_str());
}
- _disabled = true;
+ if (!_terminated)
+ _disabled = true;
}
void
@@ -134,7 +135,8 @@ Process::enable(bool inc_kids)
if (inc_kids)
forEachKid([](Process *p) { p->enable(true); });
- _disabled = false;
+ if (!_terminated)
+ _disabled = false;
}
void
@@ -149,8 +151,8 @@ Process::kill(bool inc_kids)
if (inc_kids)
forEachKid([](Process *p) { p->kill(true); });
- // If we're in the middle of unwinding, ignore the kill request.
- if (_isUnwinding)
+ // If we're unwinding or terminated, ignore the kill request.
+ if (_isUnwinding || _terminated)
return;
// Update our state.
@@ -177,8 +179,8 @@ Process::reset(bool inc_kids)
if (inc_kids)
forEachKid([](Process *p) { p->reset(true); });
- // If we're in the middle of unwinding, ignore the reset request.
- if (_isUnwinding)
+ // If we're already unwinding or terminated, ignore the reset request.
+ if (_isUnwinding || _terminated)
return;
// Clear suspended ready since we're about to run regardless.