summaryrefslogtreecommitdiff
path: root/dev/etherpkt.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/etherpkt.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/etherpkt.cc')
-rw-r--r--dev/etherpkt.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/dev/etherpkt.cc b/dev/etherpkt.cc
index 273b8ee64..bf60bc150 100644
--- a/dev/etherpkt.cc
+++ b/dev/etherpkt.cc
@@ -28,22 +28,23 @@
#include <iostream>
+#include "base/misc.hh"
#include "dev/etherpkt.hh"
#include "sim/serialize.hh"
using namespace std;
void
-PacketData::serialize(ostream &os)
+PacketData::serialize(const string &base, ostream &os)
{
- SERIALIZE_SCALAR(length);
- SERIALIZE_ARRAY(data, length);
+ paramOut(os, base + ".length", length);
+ arrayParamOut(os, base + ".data", data, length);
}
void
-PacketData::unserialize(Checkpoint *cp, const string &section)
+PacketData::unserialize(const string &base, Checkpoint *cp,
+ const string &section)
{
- UNSERIALIZE_SCALAR(length);
- data = new uint8_t[length];
- UNSERIALIZE_ARRAY(data, length);
+ paramIn(cp, section, base + ".length", length);
+ arrayParamIn(cp, section, base + ".data", data, length);
}