summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2012-01-07 02:16:37 -0800
committerGabe Black <gblack@eecs.umich.edu>2012-01-07 02:16:37 -0800
commit241cc0c8402f1b9f2ec20d1cc152d96930959b2a (patch)
tree666717370cc9db4775ef46c10f7d8a92a34f40e2 /src/sim
parentec936364b7238cddea7734ea79c6e04b52a683c6 (diff)
parent4b772782871f265cf7372c984ad750803396938c (diff)
downloadgem5-241cc0c8402f1b9f2ec20d1cc152d96930959b2a.tar.xz
Another merge with the main repository.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/eventq.cc8
-rw-r--r--src/sim/eventq.hh10
2 files changed, 18 insertions, 0 deletions
diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc
index 78524fe51..b389efcf2 100644
--- a/src/sim/eventq.cc
+++ b/src/sim/eventq.cc
@@ -373,6 +373,14 @@ EventQueue::debugVerify() const
return true;
}
+Event*
+EventQueue::replaceHead(Event* s)
+{
+ Event* t = head;
+ head = s;
+ return t;
+}
+
void
dumpMainQueue()
{
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh
index 1509d05a5..6dc25e760 100644
--- a/src/sim/eventq.hh
+++ b/src/sim/eventq.hh
@@ -408,6 +408,16 @@ class EventQueue : public Serializable
bool debugVerify() const;
+ /**
+ * function for replacing the head of the event queue, so that a
+ * different set of events can run without disturbing events that have
+ * already been scheduled. Already scheduled events can be processed
+ * by replacing the original head back.
+ * USING THIS FUNCTION CAN BE DANGEROUS TO THE HEALTH OF THE SIMULATOR.
+ * NOT RECOMMENDED FOR USE.
+ */
+ Event* replaceHead(Event* s);
+
#ifndef SWIG
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string &section);