summaryrefslogtreecommitdiff
path: root/src/sim/sim_events.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2011-09-22 18:59:55 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2011-09-22 18:59:55 -0700
commit84f0a1bd91b8af5517711fba00533daddb2359e1 (patch)
treee9dd08fe7ff8a575efc08c5a927c719f674d06fe /src/sim/sim_events.cc
parentba79155d9d0f42457f74b533e27f0af2ab1b5e4a (diff)
downloadgem5-84f0a1bd91b8af5517711fba00533daddb2359e1.tar.xz
event: minor cleanup
Initialize flags via the Event constructor instead of calling setFlags() in the body of the derived class's constructor. I forget exactly why, but this made life easier when implementing multi-queue support. Also rename Event::getFlags() to isFlagSet() to better match common usage, and get rid of some unused Event methods.
Diffstat (limited to 'src/sim/sim_events.cc')
-rw-r--r--src/sim/sim_events.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/sim/sim_events.cc b/src/sim/sim_events.cc
index aac844429..725e7da9d 100644
--- a/src/sim/sim_events.cc
+++ b/src/sim/sim_events.cc
@@ -40,9 +40,8 @@
using namespace std;
SimLoopExitEvent::SimLoopExitEvent(const std::string &_cause, int c, Tick r)
- : Event(Sim_Exit_Pri), cause(_cause), code(c), repeat(r)
+ : Event(Sim_Exit_Pri, IsExitEvent), cause(_cause), code(c), repeat(r)
{
- setFlags(IsExitEvent);
}
@@ -55,7 +54,7 @@ SimLoopExitEvent::process()
// if this got scheduled on a different queue (e.g. the committed
// instruction queue) then make a corresponding event on the main
// queue.
- if (!getFlags(IsMainQueue)) {
+ if (!isFlagSet(IsMainQueue)) {
exitSimLoop(cause, code);
delete this;
}
@@ -65,7 +64,7 @@ SimLoopExitEvent::process()
// but if you are doing this on intervals, don't forget to make another
if (repeat) {
- assert(getFlags(IsMainQueue));
+ assert(isFlagSet(IsMainQueue));
mainEventQueue.schedule(this, curTick() + repeat);
}
}