From: Steve Raasch Date: Thu, 30 Oct 2003 20:15:27 +0000 (-0500) Subject: Add support for serialization X-Git-Tag: m5_1.0_beta2~315^2~1 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9dac0d3c568d8767a2022afaaf958455df012e42;p=gem5.git Add support for serialization --HG-- extra : convert_revision : ff6c93ee2f4e6aeb5a824958c52f62d6c2a1cdfd --- 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 §ion) +{ + 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 #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 §ion); }; class PollQueue