summaryrefslogtreecommitdiff
path: root/sim/eventq.cc
diff options
context:
space:
mode:
authorAndrew Schultz <alschult@umich.edu>2003-10-31 22:09:18 -0500
committerAndrew Schultz <alschult@umich.edu>2003-10-31 22:09:18 -0500
commit59eeb1bb52aeec8c3c406d25598ae729ceb4e6bb (patch)
tree657cda9cf38d6040ee894a56236449e5dff22a04 /sim/eventq.cc
parent518654dce41c0348f383a069b627931953fe2634 (diff)
downloadgem5-59eeb1bb52aeec8c3c406d25598ae729ceb4e6bb.tar.xz
eventq.cc, eventq.hh:
Cleaned up serialization sim/eventq.hh: sim/eventq.cc: Cleaned up serialization --HG-- extra : convert_revision : b75696d75f1aee16ebca2076fdd3cd4913593762
Diffstat (limited to 'sim/eventq.cc')
-rw-r--r--sim/eventq.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/sim/eventq.cc b/sim/eventq.cc
index eab499bd9..fda587dcb 100644
--- a/sim/eventq.cc
+++ b/sim/eventq.cc
@@ -42,8 +42,6 @@
using namespace std;
-const string Event::defaultName("event");
-
//
// Main Event Queue
//
@@ -160,19 +158,13 @@ EventQueue::serialize(ostream &os)
while (event) {
if (event->getFlags(Event::AutoSerialize)) {
eventPtrs.push_back(event);
- numEvents++;
+ paramOut(os, csprintf("event%d", numEvents++), event->name());
}
event = event->next;
}
SERIALIZE_SCALAR(numEvents);
- int i = 0;
- for (std::list<Event *>::iterator it=eventPtrs.begin();
- it != eventPtrs.end(); ++it) {
- paramOut(os, csprintf("%s.eventPtr%d", name(), i++), (uintptr_t)*it);
- }
-
for (std::list<Event *>::iterator it=eventPtrs.begin();
it != eventPtrs.end(); ++it) {
(*it)->nameOut(os);
@@ -184,16 +176,15 @@ void
EventQueue::unserialize(Checkpoint *cp, const std::string &section)
{
int numEvents;
- uintptr_t ptr;
-
UNSERIALIZE_SCALAR(numEvents);
+ std::string eventName;
for (int i = 0; i < numEvents; i++) {
// get the pointer value associated with the event
- paramIn(cp, section, csprintf("%s.eventPtr%d", name(), i), ptr);
+ paramIn(cp, section, csprintf("event%d", i), eventName);
// create the event based on its pointer value
- Serializeable::create(cp, csprintf("%s_%x", Event::defaultName, ptr));
+ Serializeable::create(cp, eventName);
}
}