summaryrefslogtreecommitdiff
path: root/src/sim/eventq.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2015-07-07 09:51:04 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2015-07-07 09:51:04 +0100
commit888ec455cba4174863be5ed9148aaf093a061101 (patch)
treeccf37fcf4b72fc5de4dcea4ec730aab7f660e572 /src/sim/eventq.hh
parent76cd4393c08b83fa9006ee7bce1fb62457e053c1 (diff)
downloadgem5-888ec455cba4174863be5ed9148aaf093a061101.tar.xz
sim: Fix broken event unserialization
Events expected to be unserialized using an event-specific unserializeEvent call. This call was never actually used, which meant the events relying on it never got unserialized (or scheduled after unserialization). Instead of relying on a custom call, we now use the normal serialization code again. In order to schedule the event correctly, the parrent object is expected to use the EventQueue::checkpointReschedule() call. This happens automatically for events that are serialized using the AutoSerialize mechanism.
Diffstat (limited to 'src/sim/eventq.hh')
-rw-r--r--src/sim/eventq.hh19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/sim/eventq.hh b/src/sim/eventq.hh
index b90e5d382..cfb79614f 100644
--- a/src/sim/eventq.hh
+++ b/src/sim/eventq.hh
@@ -352,12 +352,6 @@ class Event : public EventBase, public Serializable
#ifndef SWIG
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
-
- //! This function is required to support restoring from checkpoints
- //! when running with multiple queues. Since we still have not thrashed
- //! out all the details on checkpointing, this function is most likely
- //! to be revisited in future.
- virtual void unserializeEvent(CheckpointIn &cp, EventQueue *eventq);
#endif
};
@@ -650,6 +644,19 @@ class EventQueue : public Serializable
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
#endif
+ /**
+ * Reschedule an event after a checkpoint.
+ *
+ * Since events don't know which event queue they belong to,
+ * parent objects need to reschedule events themselves. This
+ * method conditionally schedules an event that has the Scheduled
+ * flag set. It should be called by parent objects after
+ * unserializing an object.
+ *
+ * @warn Only use this method after unserializing an Event.
+ */
+ void checkpointReschedule(Event *event);
+
virtual ~EventQueue() { }
};