summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Raasch <sraasch@umich.edu>2003-10-30 15:15:27 -0500
committerSteve Raasch <sraasch@umich.edu>2003-10-30 15:15:27 -0500
commit9dac0d3c568d8767a2022afaaf958455df012e42 (patch)
tree040d9b7d28972b93e448011cb24be2779a91e2f1
parent101aa8090a9bdf2a702bb8e17431080879a40ba1 (diff)
downloadgem5-9dac0d3c568d8767a2022afaaf958455df012e42.tar.xz
Add support for serialization
--HG-- extra : convert_revision : ff6c93ee2f4e6aeb5a824958c52f62d6c2a1cdfd
-rw-r--r--base/pollevent.cc19
-rw-r--r--base/pollevent.hh5
2 files changed, 24 insertions, 0 deletions
diff --git a/base/pollevent.cc b/base/pollevent.cc
index 45a32581f..619bda887 100644
--- a/base/pollevent.cc
+++ b/base/pollevent.cc
@@ -38,6 +38,9 @@
#include "base/misc.hh"
#include "base/pollevent.hh"
#include "sim/universe.hh"
+#include "sim/serialize.hh"
+
+using namespace std;
PollQueue pollQueue;
@@ -76,6 +79,22 @@ PollEvent::enable()
queue->copy();
}
+void
+PollEvent::serialize(ostream &os)
+{
+ SERIALIZE_SCALAR(pfd.fd);
+ SERIALIZE_SCALAR(pfd.events);
+ SERIALIZE_SCALAR(enabled);
+}
+
+void
+PollEvent::unserialize(Checkpoint *cp, const std::string &section)
+{
+ UNSERIALIZE_SCALAR(pfd.fd);
+ UNSERIALIZE_SCALAR(pfd.events);
+ UNSERIALIZE_SCALAR(enabled);
+}
+
/////////////////////////////////////////////////////
//
PollQueue::PollQueue()
diff --git a/base/pollevent.hh b/base/pollevent.hh
index 393c53996..7ea5b83f4 100644
--- a/base/pollevent.hh
+++ b/base/pollevent.hh
@@ -33,6 +33,8 @@
#include <poll.h>
#include "sim/universe.hh"
+class Checkpoint;
+
class PollEvent
{
private:
@@ -52,6 +54,9 @@ class PollEvent
virtual void process(int revent) = 0;
bool queued() { return queue != 0; }
+
+ virtual void serialize(std::ostream &os);
+ virtual void unserialize(Checkpoint *cp, const std::string &section);
};
class PollQueue