Serialize kernel/hle/memory

This commit is contained in:
Hamish Milne 2019-12-22 18:35:03 +00:00 committed by zhupengfei
parent 050c3bdee5
commit 8c81500dee
4 changed files with 40 additions and 4 deletions

View file

@ -108,6 +108,7 @@ void KernelSystem::AddNamedPort(std::string name, std::shared_ptr<ClientPort> po
template <class Archive>
void KernelSystem::serialize(Archive& ar, const unsigned int file_version)
{
ar & memory_regions;
ar & named_ports;
ar & *current_cpu.get();
// NB: subsystem references and prepare_reschedule_callback are constant
@ -120,7 +121,6 @@ void KernelSystem::serialize(Archive& ar, const unsigned int file_version)
ar & *thread_manager.get();
ar & *config_mem_handler.get();
// Shared page data is read-only at the moment, so doesn't need serializing
//ar & *shared_page_handler.get();
}
SERIALIZE_IMPL(KernelSystem)

View file

@ -6,6 +6,8 @@
#include <optional>
#include <boost/icl/interval_set.hpp>
#include <boost/serialization/set.hpp>
#include "common/serialization/boost_discrete_interval.hpp"
#include "common/common_types.h"
namespace Kernel {
@ -69,7 +71,8 @@ private:
ar & base;
ar & size;
ar & used;
// TODO: boost icl / free_blocks
// This works because interval_set has exactly one member of type ImplSetT
ar & *(reinterpret_cast<IntervalSet::ImplSetT*>(&free_blocks));
}
};