From e51b075a2706180bdc262cbcbdd5bafe5896ba12 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 17 Oct 2006 19:38:36 -0400 Subject: add code to serialize se structures. Lisa is working on the python side of things and will test src/mem/page_table.cc: src/mem/page_table.hh: add code to serialize/unserialize page table src/sim/process.cc: src/sim/process.hh: add code to serialize/unserialize process --HG-- extra : convert_revision : ee9eb5e2c38c5d317a2f381972c552d455e0db9e --- src/sim/process.cc | 35 +++++++++++++++++++++++++++++++++++ src/sim/process.hh | 3 +++ 2 files changed, 38 insertions(+) (limited to 'src/sim') diff --git a/src/sim/process.cc b/src/sim/process.cc index 46ccd2596..f3e289d41 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -240,6 +240,41 @@ Process::sim_fd(int tgt_fd) return fd_map[tgt_fd]; } +void +Process::serialize(std::ostream &os) +{ + SERIALIZE_SCALAR(initialContextLoaded); + SERIALIZE_SCALAR(brk_point); + SERIALIZE_SCALAR(stack_base); + SERIALIZE_SCALAR(stack_size); + SERIALIZE_SCALAR(stack_min); + SERIALIZE_SCALAR(next_thread_stack_base); + SERIALIZE_SCALAR(mmap_start); + SERIALIZE_SCALAR(mmap_end); + SERIALIZE_SCALAR(nxm_start); + SERIALIZE_SCALAR(nxm_end); + SERIALIZE_ARRAY(fd_map, MAX_FD); + + pTable->serialize(os); +} + +void +Process::unserialize(Checkpoint *cp, const std::string §ion) +{ + UNSERIALIZE_SCALAR(initialContextLoaded); + UNSERIALIZE_SCALAR(brk_point); + UNSERIALIZE_SCALAR(stack_base); + UNSERIALIZE_SCALAR(stack_size); + UNSERIALIZE_SCALAR(stack_min); + UNSERIALIZE_SCALAR(next_thread_stack_base); + UNSERIALIZE_SCALAR(mmap_start); + UNSERIALIZE_SCALAR(mmap_end); + UNSERIALIZE_SCALAR(nxm_start); + UNSERIALIZE_SCALAR(nxm_end); + UNSERIALIZE_ARRAY(fd_map, MAX_FD); + + pTable->unserialize(cp, section); +} // diff --git a/src/sim/process.hh b/src/sim/process.hh index b2777170f..5c37f725e 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -162,6 +162,9 @@ class Process : public SimObject int sim_fd(int tgt_fd); virtual void syscall(int64_t callnum, ThreadContext *tc) = 0; + + void serialize(std::ostream &os); + void unserialize(Checkpoint *cp, const std::string §ion); }; // -- cgit v1.2.3