summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisa Hsu <Lisa.Hsu@amd.com>2010-06-09 10:47:37 -0700
committerLisa Hsu <Lisa.Hsu@amd.com>2010-06-09 10:47:37 -0700
commitaa7888797032bab49b5f0f637c859740497423d8 (patch)
tree1a90476ffb4bc920f7f40fd415fefc42d93fa927
parentd28572499fb224c310f5d0726b3e2eb64235c291 (diff)
downloadgem5-aa7888797032bab49b5f0f637c859740497423d8.tar.xz
flags: add comment to avoid future deletions since code appears redundant.
-rw-r--r--src/sim/eventq.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc
index 900a6dd4b..d46061064 100644
--- a/src/sim/eventq.cc
+++ b/src/sim/eventq.cc
@@ -233,15 +233,22 @@ Event::unserialize(Checkpoint *cp, const string &section)
UNSERIALIZE_SCALAR(_when);
UNSERIALIZE_SCALAR(_priority);
- // need to see if original event was in a scheduled, unsquashed
- // state, but don't want to restore those flags in the current
- // object itself (since they aren't immediately true)
short _flags;
UNSERIALIZE_SCALAR(_flags);
+
+ // Old checkpoints had no concept of the Initialized flag
+ // so restoring from old checkpoints always fail.
+ // Events are initialized on construction but original code
+ // "flags = _flags" would just overwrite the initialization.
+ // So, read in the checkpoint flags, but then set the Initialized
+ // flag on top of it in order to avoid failures.
assert(initialized());
flags = _flags;
flags.set(Initialized);
+ // need to see if original event was in a scheduled, unsquashed
+ // state, but don't want to restore those flags in the current
+ // object itself (since they aren't immediately true)
bool wasScheduled = flags.isSet(Scheduled) && !flags.isSet(Squashed);
flags.clear(Squashed | Scheduled);