summaryrefslogtreecommitdiff
path: root/dev/etherlink.cc
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-11-13 16:46:56 -0500
committerNathan Binkert <binkertn@umich.edu>2004-11-13 16:46:56 -0500
commit8922d699532cf5027c8cabe53aaf8be4db470764 (patch)
treefac37c5c456d6507f483de7566d965072dbf19c7 /dev/etherlink.cc
parentacb98fb0f64a3b6a4f2f3151b0d4fb14fdfcf7cf (diff)
downloadgem5-8922d699532cf5027c8cabe53aaf8be4db470764.tar.xz
change the serialization of a packet so that we don't
do a nameOut. This fixes a subtle bug in serialization that can pop up. --HG-- extra : convert_revision : b52df977dcbef1c9bd0d4405ba0b36dff3737cdf
Diffstat (limited to 'dev/etherlink.cc')
-rw-r--r--dev/etherlink.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/dev/etherlink.cc b/dev/etherlink.cc
index a361713cd..1e2be41fe 100644
--- a/dev/etherlink.cc
+++ b/dev/etherlink.cc
@@ -185,10 +185,8 @@ EtherLink::Link::serialize(ostream &os)
SERIALIZE_SCALAR(event_time);
}
- if (packet_exists) {
- nameOut(os, csprintf("%s.packet", name()));
- packet->serialize(os);
- }
+ if (packet_exists)
+ packet->serialize("packet", os);
}
void
@@ -198,7 +196,7 @@ EtherLink::Link::unserialize(Checkpoint *cp, const string &section)
UNSERIALIZE_SCALAR(packet_exists);
if (packet_exists) {
packet = new PacketData;
- packet->unserialize(cp, csprintf("%s.packet", section));
+ packet->unserialize("packet", cp, section);
}
bool event_scheduled;
@@ -238,8 +236,7 @@ LinkDelayEvent::serialize(ostream &os)
Event::serialize(os);
SERIALIZE_OBJPTR(link);
- nameOut(os, csprintf("%s.packet", name()));
- packet->serialize(os);
+ packet->serialize("packet", os);
}
@@ -248,7 +245,7 @@ LinkDelayEvent::unserialize(Checkpoint *cp, const string &section)
{
Event::unserialize(cp, section);
packet = new PacketData;
- packet->unserialize(cp, csprintf("%s.packet", section));
+ packet->unserialize("packet", cp, section);
}