From: Andrew Schultz Date: Sat, 1 Nov 2003 03:09:18 +0000 (-0500) Subject: eventq.cc, eventq.hh: X-Git-Tag: m5_1.0_beta2~305 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59eeb1bb52aeec8c3c406d25598ae729ceb4e6bb;p=gem5.git eventq.cc, eventq.hh: Cleaned up serialization sim/eventq.hh: sim/eventq.cc: Cleaned up serialization --HG-- extra : convert_revision : b75696d75f1aee16ebca2076fdd3cd4913593762 --- 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::iterator it=eventPtrs.begin(); - it != eventPtrs.end(); ++it) { - paramOut(os, csprintf("%s.eventPtr%d", name(), i++), (uintptr_t)*it); - } - for (std::list::iterator it=eventPtrs.begin(); it != eventPtrs.end(); ++it) { (*it)->nameOut(os); @@ -184,16 +176,15 @@ void EventQueue::unserialize(Checkpoint *cp, const std::string §ion) { 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); } } diff --git a/sim/eventq.hh b/sim/eventq.hh index ddf4c3198..475c4face 100644 --- a/sim/eventq.hh +++ b/sim/eventq.hh @@ -97,8 +97,6 @@ class Event : public Serializeable, public FastAlloc public: - static const std::string defaultName; - /* * Event constructor * @param queue that the event gets scheduled on @@ -115,7 +113,7 @@ class Event : public Serializeable, public FastAlloc ~Event() {} virtual std::string name() const { - return csprintf("%s_%x", defaultName, (uintptr_t)this); + return csprintf("Event_%x", (uintptr_t)this); } /// Determine if the current event is scheduled