diff options
-rw-r--r-- | src/sim/mem_state.hh | 27 | ||||
-rw-r--r-- | src/sim/process.cc | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/src/sim/mem_state.hh b/src/sim/mem_state.hh index 03a719752..ca07a64ef 100644 --- a/src/sim/mem_state.hh +++ b/src/sim/mem_state.hh @@ -31,6 +31,8 @@ #ifndef SRC_SIM_MEM_STATE_HH #define SRC_SIM_MEM_STATE_HH +#include "sim/serialize.hh" + /** * This class holds the memory state for the Process class and all of its * derived, architecture-specific children. @@ -45,7 +47,7 @@ * pointer interface because two process can potentially share their virtual * address space if certain options are passed into the clone(2). */ -class MemState +class MemState : public Serializable { public: MemState(Addr brk_point, Addr stack_base, Addr max_stack_size, @@ -87,6 +89,29 @@ class MemState void setNextThreadStackBase(Addr ntsb) { _nextThreadStackBase = ntsb; } void setMmapEnd(Addr mmap_end) { _mmapEnd = mmap_end; } + void + serialize(CheckpointOut &cp) const override + { + paramOut(cp, "brkPoint", _brkPoint); + paramOut(cp, "stackBase", _stackBase); + paramOut(cp, "stackSize", _stackSize); + paramOut(cp, "maxStackSize", _maxStackSize); + paramOut(cp, "stackMin", _stackMin); + paramOut(cp, "nextThreadStackBase", _nextThreadStackBase); + paramOut(cp, "mmapEnd", _mmapEnd); + } + void + unserialize(CheckpointIn &cp) override + { + paramIn(cp, "brkPoint", _brkPoint); + paramIn(cp, "stackBase", _stackBase); + paramIn(cp, "stackSize", _stackSize); + paramIn(cp, "maxStackSize", _maxStackSize); + paramIn(cp, "stackMin", _stackMin); + paramIn(cp, "nextThreadStackBase", _nextThreadStackBase); + paramIn(cp, "mmapEnd", _mmapEnd); + } + private: Addr _brkPoint; Addr _stackBase; diff --git a/src/sim/process.cc b/src/sim/process.cc index bfc52c361..ee90667ff 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -367,6 +367,7 @@ Process::fixupStackFault(Addr vaddr) void Process::serialize(CheckpointOut &cp) const { + memState->serialize(cp); pTable->serialize(cp); /** * Checkpoints for file descriptors currently do not work. Need to @@ -384,6 +385,7 @@ Process::serialize(CheckpointOut &cp) const void Process::unserialize(CheckpointIn &cp) { + memState->unserialize(cp); pTable->unserialize(cp); /** * Checkpoints for file descriptors currently do not work. Need to |