citra-emu
/
citra
Archived
1
0
Fork 0

clang-format fixes

This commit is contained in:
Hamish Milne 2019-12-27 21:07:29 +00:00 committed by zhupengfei
parent d482fb359c
commit 7b846ffa98
117 changed files with 797 additions and 925 deletions

View File

@ -5,16 +5,11 @@
using iarchive = boost::archive::binary_iarchive; using iarchive = boost::archive::binary_iarchive;
using oarchive = boost::archive::binary_oarchive; using oarchive = boost::archive::binary_oarchive;
#define SERIALIZE_IMPL(A) template void A::serialize<iarchive>( \ #define SERIALIZE_IMPL(A) \
iarchive & ar, \ template void A::serialize<iarchive>(iarchive & ar, const unsigned int file_version); \
const unsigned int file_version \ template void A::serialize<oarchive>(oarchive & ar, const unsigned int file_version);
); \
template void A::serialize<oarchive>( \
oarchive & ar, \
const unsigned int file_version \
);
#define SERIALIZE_EXPORT_IMPL(A) \ #define SERIALIZE_EXPORT_IMPL(A) \
BOOST_SERIALIZATION_REGISTER_ARCHIVE(iarchive) \ BOOST_SERIALIZATION_REGISTER_ARCHIVE(iarchive) \
BOOST_SERIALIZATION_REGISTER_ARCHIVE(oarchive) \ BOOST_SERIALIZATION_REGISTER_ARCHIVE(oarchive) \
BOOST_CLASS_EXPORT_IMPLEMENT(A) BOOST_CLASS_EXPORT_IMPLEMENT(A)

View File

@ -2,28 +2,26 @@
class construct_access { class construct_access {
public: public:
template<class Archive, class T> template <class Archive, class T>
static inline void save_construct(Archive & ar, const T * t, const unsigned int file_version) { static inline void save_construct(Archive& ar, const T* t, const unsigned int file_version) {
t->save_construct(ar, file_version); t->save_construct(ar, file_version);
} }
template<class Archive, class T> template <class Archive, class T>
static inline void load_construct(Archive & ar, T * t, const unsigned int file_version) { static inline void load_construct(Archive& ar, T* t, const unsigned int file_version) {
T::load_construct(ar, t, file_version); T::load_construct(ar, t, file_version);
} }
}; };
#define BOOST_SERIALIZATION_CONSTRUCT(T) \ #define BOOST_SERIALIZATION_CONSTRUCT(T) \
namespace boost { namespace serialization { \ namespace boost { \
template<class Archive> \ namespace serialization { \
inline void save_construct_data( \ template <class Archive> \
Archive & ar, const T * t, const unsigned int file_version \ inline void save_construct_data(Archive& ar, const T* t, const unsigned int file_version) { \
){ \
construct_access::save_construct(ar, t, file_version); \ construct_access::save_construct(ar, t, file_version); \
} \ } \
template<class Archive> \ template <class Archive> \
inline void load_construct_data( \ inline void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \
Archive & ar, T * t, const unsigned int file_version \
){ \
construct_access::load_construct(ar, t, file_version); \ construct_access::load_construct(ar, t, file_version); \
} \ } \
}} } \
}

View File

@ -1,20 +1,17 @@
#include "boost/serialization/split_member.hpp" #include "boost/serialization/split_member.hpp"
#define SERIALIZE_AS_POD \ #define SERIALIZE_AS_POD \
private: \ private: \
friend class boost::serialization::access; \ friend class boost::serialization::access; \
template<typename Archive> \ template <typename Archive> \
void save(Archive & ar, const unsigned int file_version) const { \ void save(Archive& ar, const unsigned int file_version) const { \
ar.save_binary(this, sizeof(*this)); \ ar.save_binary(this, sizeof(*this)); \
} \ } \
template<typename Archive> \ template <typename Archive> \
void load(Archive & ar, const unsigned int file_version) { \ void load(Archive& ar, const unsigned int file_version) { \
ar.load_binary(this, sizeof(*this)); \ ar.load_binary(this, sizeof(*this)); \
} \ } \
template<class Archive> \ template <class Archive> \
void serialize( \ void serialize(Archive& ar, const unsigned int file_version) { \
Archive &ar, \
const unsigned int file_version \
){ \
boost::serialization::split_member(ar, *this, file_version); \ boost::serialization::split_member(ar, *this, file_version); \
} }

View File

@ -6,20 +6,17 @@
namespace boost::serialization { namespace boost::serialization {
template <class Archive, class T> template <class Archive, class T>
void serialize(Archive& ar, std::atomic<T>& value, const unsigned int file_version) void serialize(Archive& ar, std::atomic<T>& value, const unsigned int file_version) {
{
boost::serialization::split_free(ar, value, file_version); boost::serialization::split_free(ar, value, file_version);
} }
template <class Archive, class T> template <class Archive, class T>
void save(Archive& ar, const std::atomic<T>& value, const unsigned int file_version) void save(Archive& ar, const std::atomic<T>& value, const unsigned int file_version) {
{
ar << value.load(); ar << value.load();
} }
template <class Archive, class T> template <class Archive, class T>
void load(Archive& ar, std::atomic<T>& value, const unsigned int file_version) void load(Archive& ar, std::atomic<T>& value, const unsigned int file_version) {
{
T tmp; T tmp;
ar >> tmp; ar >> tmp;
value.store(tmp); value.store(tmp);

View File

@ -1,23 +1,21 @@
#pragma once #pragma once
#include "common/common_types.h"
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
#include <boost/serialization/split_free.hpp> #include <boost/serialization/split_free.hpp>
#include "common/common_types.h"
namespace boost::serialization { namespace boost::serialization {
template <class Archive, class T> template <class Archive, class T>
void save(Archive& ar, const boost::container::flat_set<T>& set, const unsigned int file_version) void save(Archive& ar, const boost::container::flat_set<T>& set, const unsigned int file_version) {
{
ar << static_cast<u64>(set.size()); ar << static_cast<u64>(set.size());
for (auto &v : set) { for (auto& v : set) {
ar << v; ar << v;
} }
} }
template <class Archive, class T> template <class Archive, class T>
void load(Archive& ar, boost::container::flat_set<T>& set, const unsigned int file_version) void load(Archive& ar, boost::container::flat_set<T>& set, const unsigned int file_version) {
{
u64 count{}; u64 count{};
ar >> count; ar >> count;
set.clear(); set.clear();
@ -29,9 +27,8 @@ void load(Archive& ar, boost::container::flat_set<T>& set, const unsigned int fi
} }
template <class Archive, class T> template <class Archive, class T>
void serialize(Archive& ar, boost::container::flat_set<T>& set, const unsigned int file_version) void serialize(Archive& ar, boost::container::flat_set<T>& set, const unsigned int file_version) {
{
boost::serialization::split_free(ar, set, file_version); boost::serialization::split_free(ar, set, file_version);
} }
} } // namespace boost::serialization

View File

@ -7,85 +7,70 @@
#include <optional> #include <optional>
#include <boost/move/utility_core.hpp> #include <boost/move/utility_core.hpp>
#include <boost/serialization/detail/is_default_constructible.hpp>
#include <boost/serialization/detail/stack_constructor.hpp>
#include <boost/serialization/force_include.hpp>
#include <boost/serialization/item_version_type.hpp> #include <boost/serialization/item_version_type.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/level.hpp> #include <boost/serialization/level.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/version.hpp> #include <boost/serialization/version.hpp>
#include <boost/type_traits/is_pointer.hpp> #include <boost/type_traits/is_pointer.hpp>
#include <boost/serialization/detail/stack_constructor.hpp>
#include <boost/serialization/detail/is_default_constructible.hpp>
#include <boost/serialization/force_include.hpp>
// function specializations must be defined in the appropriate // function specializations must be defined in the appropriate
// namespace - boost::serialization // namespace - boost::serialization
namespace boost { namespace boost {
namespace serialization { namespace serialization {
template<class Archive, class T> template <class Archive, class T>
void save( void save(Archive& ar, const std::optional<T>& t, const unsigned int /*version*/
Archive & ar, ) {
const std::optional< T > & t, // It is an inherent limitation to the serialization of optional.hpp
const unsigned int /*version*/ // that the underlying type must be either a pointer or must have a
){ // default constructor. It's possible that this could change sometime
// It is an inherent limitation to the serialization of optional.hpp // in the future, but for now, one will have to work around it. This can
// that the underlying type must be either a pointer or must have a // be done by serialization the optional<T> as optional<T *>
// default constructor. It's possible that this could change sometime #if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
// in the future, but for now, one will have to work around it. This can BOOST_STATIC_ASSERT(boost::serialization::detail::is_default_constructible<T>::value ||
// be done by serialization the optional<T> as optional<T *> boost::is_pointer<T>::value);
#if ! defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) #endif
BOOST_STATIC_ASSERT(
boost::serialization::detail::is_default_constructible<T>::value
|| boost::is_pointer<T>::value
);
#endif
const bool tflag = t.has_value(); const bool tflag = t.has_value();
ar << boost::serialization::make_nvp("initialized", tflag); ar << boost::serialization::make_nvp("initialized", tflag);
if (tflag){ if (tflag) {
ar << boost::serialization::make_nvp("value", *t); ar << boost::serialization::make_nvp("value", *t);
} }
} }
template<class Archive, class T> template <class Archive, class T>
void load( void load(Archive& ar, std::optional<T>& t, const unsigned int version) {
Archive & ar,
std::optional< T > & t,
const unsigned int version
){
bool tflag; bool tflag;
ar >> boost::serialization::make_nvp("initialized", tflag); ar >> boost::serialization::make_nvp("initialized", tflag);
if(! tflag){ if (!tflag) {
t.reset(); t.reset();
return; return;
} }
if(0 == version){ if (0 == version) {
boost::serialization::item_version_type item_version(0); boost::serialization::item_version_type item_version(0);
boost::archive::library_version_type library_version( boost::archive::library_version_type library_version(ar.get_library_version());
ar.get_library_version() if (boost::archive::library_version_type(3) < library_version) {
);
if(boost::archive::library_version_type(3) < library_version){
ar >> BOOST_SERIALIZATION_NVP(item_version); ar >> BOOST_SERIALIZATION_NVP(item_version);
} }
} }
if(! t.has_value()) if (!t.has_value())
t = T(); t = T();
ar >> boost::serialization::make_nvp("value", *t); ar >> boost::serialization::make_nvp("value", *t);
} }
template<class Archive, class T> template <class Archive, class T>
void serialize( void serialize(Archive& ar, std::optional<T>& t, const unsigned int version) {
Archive & ar,
std::optional< T > & t,
const unsigned int version
){
boost::serialization::split_free(ar, t, version); boost::serialization::split_free(ar, t, version);
} }
template<class T> template <class T>
struct version<std::optional<T> > { struct version<std::optional<T>> {
BOOST_STATIC_CONSTANT(int, value = 1); BOOST_STATIC_CONSTANT(int, value = 1);
}; };
} // serialization } // namespace serialization
} // boost } // namespace boost

View File

@ -162,20 +162,20 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void save(Archive& ar, const unsigned int file_version) const void save(Archive& ar, const unsigned int file_version) const {
{
s32 idx = first == UnlinkedTag() ? -1 : static_cast<s32>(first - &queues[0]); s32 idx = first == UnlinkedTag() ? -1 : static_cast<s32>(first - &queues[0]);
ar << idx; ar << idx;
for (auto i = 0; i < NUM_QUEUES; i++) { for (auto i = 0; i < NUM_QUEUES; i++) {
s32 idx1 = first == UnlinkedTag() ? -1 : static_cast<s32>(queues[i].next_nonempty - &queues[0]); s32 idx1 = first == UnlinkedTag()
? -1
: static_cast<s32>(queues[i].next_nonempty - &queues[0]);
ar << idx1; ar << idx1;
ar << queues[i].data; ar << queues[i].data;
} }
} }
template <class Archive> template <class Archive>
void load(Archive& ar, const unsigned int file_version) void load(Archive& ar, const unsigned int file_version) {
{
s32 idx; s32 idx;
ar >> idx; ar >> idx;
first = idx < 0 ? UnlinkedTag() : &queues[idx]; first = idx < 0 ? UnlinkedTag() : &queues[idx];

View File

@ -46,11 +46,10 @@ class Vec4;
template <typename T> template <typename T>
class Vec2 { class Vec2 {
friend class boost::serialization::access; friend class boost::serialization::access;
template<class Archive> template <class Archive>
void serialize(Archive & ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& x;
ar & x; ar& y;
ar & y;
} }
public: public:
@ -201,12 +200,11 @@ inline float Vec2<float>::Normalize() {
template <typename T> template <typename T>
class Vec3 { class Vec3 {
friend class boost::serialization::access; friend class boost::serialization::access;
template<class Archive> template <class Archive>
void serialize(Archive & ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& x;
ar & x; ar& y;
ar & y; ar& z;
ar & z;
} }
public: public:
@ -418,13 +416,12 @@ using Vec3f = Vec3<float>;
template <typename T> template <typename T>
class Vec4 { class Vec4 {
friend class boost::serialization::access; friend class boost::serialization::access;
template<class Archive> template <class Archive>
void serialize(Archive & ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& x;
ar & x; ar& y;
ar & y; ar& z;
ar & z; ar& w;
ar & w;
} }
public: public:

View File

@ -20,8 +20,7 @@ public:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void save(Archive& ar, const unsigned int file_version) const void save(Archive& ar, const unsigned int file_version) const {
{
for (auto i = 0; i < 16; i++) { for (auto i = 0; i < 16; i++) {
auto r = GetCpuRegister(i); auto r = GetCpuRegister(i);
ar << r; ar << r;
@ -39,8 +38,7 @@ public:
} }
template <class Archive> template <class Archive>
void load(Archive& ar, const unsigned int file_version) void load(Archive& ar, const unsigned int file_version) {
{
u32 r; u32 r;
for (auto i = 0; i < 16; i++) { for (auto i = 0; i < 16; i++) {
ar >> r; ar >> r;
@ -220,8 +218,7 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void save(Archive& ar, const unsigned int file_version) const void save(Archive& ar, const unsigned int file_version) const {
{
for (auto i = 0; i < 15; i++) { for (auto i = 0; i < 15; i++) {
auto r = GetReg(i); auto r = GetReg(i);
ar << r; ar << r;
@ -245,8 +242,7 @@ private:
} }
template <class Archive> template <class Archive>
void load(Archive& ar, const unsigned int file_version) void load(Archive& ar, const unsigned int file_version) {
{
u32 r; u32 r;
for (auto i = 0; i < 15; i++) { for (auto i = 0; i < 15; i++) {
ar >> r; ar >> r;

View File

@ -48,10 +48,14 @@ namespace Core {
/*static*/ System System::s_instance; /*static*/ System System::s_instance;
template <> template <>
Core::System& Global() { return System::GetInstance(); } Core::System& Global() {
return System::GetInstance();
}
template <> template <>
Kernel::KernelSystem& Global() { return System::GetInstance().Kernel(); } Kernel::KernelSystem& Global() {
return System::GetInstance().Kernel();
}
System::ResultStatus System::RunLoop(bool tight_loop) { System::ResultStatus System::RunLoop(bool tight_loop) {
status = ResultStatus::Success; status = ResultStatus::Success;
@ -209,8 +213,8 @@ System::ResultStatus System::Init(Frontend::EmuWindow& emu_window, u32 system_mo
timing = std::make_unique<Timing>(); timing = std::make_unique<Timing>();
kernel = std::make_unique<Kernel::KernelSystem>(*memory, *timing, kernel = std::make_unique<Kernel::KernelSystem>(
[this] { PrepareReschedule(); }, system_mode); *memory, *timing, [this] { PrepareReschedule(); }, system_mode);
if (Settings::values.use_cpu_jit) { if (Settings::values.use_cpu_jit) {
#ifdef ARCHITECTURE_x86_64 #ifdef ARCHITECTURE_x86_64
@ -400,32 +404,29 @@ void System::Reset() {
Load(*m_emu_window, m_filepath); Load(*m_emu_window, m_filepath);
} }
template<class Archive> template <class Archive>
void System::serialize(Archive & ar, const unsigned int file_version) void System::serialize(Archive& ar, const unsigned int file_version) {
{ ar&* cpu_core.get();
ar & *cpu_core.get(); ar&* service_manager.get();
ar & *service_manager.get(); ar& GPU::g_regs;
ar & GPU::g_regs; ar& LCD::g_regs;
ar & LCD::g_regs;
ar & dsp_core->GetDspMemory(); ar & dsp_core->GetDspMemory();
ar & *memory.get(); ar&* memory.get();
ar & *kernel.get(); ar&* kernel.get();
} }
void System::Save(std::ostream &stream) const void System::Save(std::ostream& stream) const {
{
{ {
oarchive oa{stream}; oarchive oa{stream};
oa & *this; oa&* this;
} }
VideoCore::Save(stream); VideoCore::Save(stream);
} }
void System::Load(std::istream &stream) void System::Load(std::istream& stream) {
{
{ {
iarchive ia{stream}; iarchive ia{stream};
ia & *this; ia&* this;
} }
VideoCore::Load(stream); VideoCore::Load(stream);
} }

View File

@ -272,9 +272,9 @@ public:
return registered_image_interface; return registered_image_interface;
} }
void Save(std::ostream &stream) const; void Save(std::ostream& stream) const;
void Load(std::istream &stream); void Load(std::istream& stream);
private: private:
/** /**
@ -345,8 +345,8 @@ private:
std::atomic<bool> shutdown_requested; std::atomic<bool> shutdown_requested;
friend class boost::serialization::access; friend class boost::serialization::access;
template<typename Archive> template <typename Archive>
void serialize(Archive & ar, const unsigned int file_version); void serialize(Archive& ar, const unsigned int file_version);
}; };
inline ARM_Interface& CPU() { inline ARM_Interface& CPU() {

View File

@ -6,12 +6,12 @@
#include "common/archives.h" #include "common/archives.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/global.h"
#include "core/hle/kernel/address_arbiter.h" #include "core/hle/kernel/address_arbiter.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/memory.h" #include "core/memory.h"
#include "core/global.h"
//////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////
// Kernel namespace // Kernel namespace

View File

@ -74,11 +74,10 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); ar& name;
ar & name; ar& waiting_threads;
ar & waiting_threads;
} }
}; };

View File

@ -4,6 +4,7 @@
#include "common/archives.h" #include "common/archives.h"
#include "common/assert.h" #include "common/assert.h"
#include "core/global.h"
#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
@ -11,7 +12,6 @@
#include "core/hle/kernel/object.h" #include "core/hle/kernel/object.h"
#include "core/hle/kernel/server_port.h" #include "core/hle/kernel/server_port.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::ClientPort) SERIALIZE_EXPORT_IMPL(Kernel::ClientPort)

View File

@ -61,17 +61,15 @@ private:
friend class KernelSystem; friend class KernelSystem;
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); ar& server_port;
ar & server_port; ar& max_sessions;
ar & max_sessions; ar& active_sessions;
ar & active_sessions; ar& name;
ar & name;
} }
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/assert.h"
#include "common/archives.h" #include "common/archives.h"
#include "common/assert.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/hle_ipc.h"

View File

@ -53,11 +53,10 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); ar& name;
ar & name; ar& parent;
ar & parent;
} }
}; };

View File

@ -60,10 +60,9 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{
auto o_config_mem = boost::serialization::binary_object(&config_mem, sizeof(config_mem)); auto o_config_mem = boost::serialization::binary_object(&config_mem, sizeof(config_mem));
ar & o_config_mem; ar& o_config_mem;
} }
}; };

View File

@ -5,8 +5,8 @@
#include <algorithm> #include <algorithm>
#include <map> #include <map>
#include <vector> #include <vector>
#include "common/assert.h"
#include "common/archives.h" #include "common/archives.h"
#include "common/assert.h"
#include "core/hle/kernel/event.h" #include "core/hle/kernel/event.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"

View File

@ -53,12 +53,11 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<WaitObject>(*this);
ar & boost::serialization::base_object<WaitObject>(*this); ar& reset_type;
ar & reset_type; ar& signaled;
ar & signaled; ar& name;
ar & name;
} }
}; };

View File

@ -121,12 +121,11 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& objects;
ar & objects; ar& generations;
ar & generations; ar& next_generation;
ar & next_generation; ar& next_free_slot;
ar & next_free_slot;
} }
}; };

View File

@ -11,10 +11,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/container/small_vector.hpp> #include <boost/container/small_vector.hpp>
#include <boost/serialization/unique_ptr.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/assume_abstract.hpp> #include <boost/serialization/assume_abstract.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/unique_ptr.hpp>
#include <boost/serialization/vector.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/swap.h" #include "common/swap.h"
#include "core/hle/ipc.h" #include "core/hle/ipc.h"
@ -74,9 +74,10 @@ public:
/// in each service must inherit from this. /// in each service must inherit from this.
struct SessionDataBase { struct SessionDataBase {
virtual ~SessionDataBase() = default; virtual ~SessionDataBase() = default;
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) { } void serialize(Archive& ar, const unsigned int file_version) {}
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -104,10 +105,9 @@ protected:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& session;
ar & session; ar& data;
ar & data;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -117,9 +117,8 @@ protected:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& connected_sessions;
ar & connected_sessions;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -30,15 +30,15 @@ struct MappedBufferContext {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& permissions;
ar & permissions; ar& size;
ar & size; ar& source_address;
ar & source_address; ar& target_address;
ar & target_address; // TODO: Check whether we need these. If we do, add a field for the size and/or change to a
// TODO: Check whether we need these. If we do, add a field for the size and/or change to a 'vector' // 'vector'
//ar & buffer; // ar & buffer;
//ar & reserve_buffer; // ar & reserve_buffer;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -104,20 +104,19 @@ void KernelSystem::AddNamedPort(std::string name, std::shared_ptr<ClientPort> po
} }
template <class Archive> template <class Archive>
void KernelSystem::serialize(Archive& ar, const unsigned int file_version) void KernelSystem::serialize(Archive& ar, const unsigned int file_version) {
{ ar& memory_regions;
ar & memory_regions; ar& named_ports;
ar & named_ports; ar&* current_cpu.get();
ar & *current_cpu.get();
// NB: subsystem references and prepare_reschedule_callback are constant // NB: subsystem references and prepare_reschedule_callback are constant
ar & *resource_limits.get(); ar&* resource_limits.get();
ar & next_object_id; ar& next_object_id;
ar & *timer_manager.get(); ar&* timer_manager.get();
ar & next_process_id; ar& next_process_id;
ar & process_list; ar& process_list;
ar & current_process; ar& current_process;
ar & *thread_manager.get(); ar&* thread_manager.get();
ar & *config_mem_handler.get(); ar&* config_mem_handler.get();
// Shared page data is read-only at the moment, so doesn't need serializing // Shared page data is read-only at the moment, so doesn't need serializing
// Deliberately don't include debugger info to allow debugging through loads // Deliberately don't include debugger info to allow debugging through loads
} }

View File

@ -7,8 +7,8 @@
#include <optional> #include <optional>
#include <boost/icl/interval_set.hpp> #include <boost/icl/interval_set.hpp>
#include <boost/serialization/set.hpp> #include <boost/serialization/set.hpp>
#include "common/serialization/boost_discrete_interval.hpp"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/serialization/boost_discrete_interval.hpp"
namespace Kernel { namespace Kernel {
@ -66,13 +66,12 @@ struct MemoryRegionInfo {
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& base;
ar & base; ar& size;
ar & size; ar& used;
ar & used;
// This works because interval_set has exactly one member of type ImplSetT // This works because interval_set has exactly one member of type ImplSetT
ar & *(reinterpret_cast<IntervalSet::ImplSetT*>(&free_blocks)); ar&*(reinterpret_cast<IntervalSet::ImplSetT*>(&free_blocks));
} }
}; };

View File

@ -7,12 +7,12 @@
#include "common/archives.h" #include "common/archives.h"
#include "common/assert.h" #include "common/assert.h"
#include "core/core.h" #include "core/core.h"
#include "core/global.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/mutex.h"
#include "core/hle/kernel/object.h" #include "core/hle/kernel/object.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::Mutex) SERIALIZE_EXPORT_IMPL(Kernel::Mutex)

View File

@ -62,13 +62,12 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<WaitObject>(*this);
ar & boost::serialization::base_object<WaitObject>(*this); ar& lock_count;
ar & lock_count; ar& priority;
ar & priority; ar& name;
ar & name; ar& holding_thread;
ar & holding_thread;
} }
}; };

View File

@ -10,10 +10,10 @@
#include <boost/serialization/access.hpp> #include <boost/serialization/access.hpp>
#include <boost/serialization/assume_abstract.hpp> #include <boost/serialization/assume_abstract.hpp>
#include <boost/serialization/export.hpp> #include <boost/serialization/export.hpp>
#include "common/serialization/atomic.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/kernel/kernel.h" #include "common/serialization/atomic.h"
#include "core/global.h" #include "core/global.h"
#include "core/hle/kernel/kernel.h"
namespace Kernel { namespace Kernel {
@ -72,9 +72,8 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& object_id;
ar & object_id;
} }
}; };
@ -103,10 +102,9 @@ inline std::shared_ptr<T> DynamicObjectCast(std::shared_ptr<Object> object) {
BOOST_SERIALIZATION_ASSUME_ABSTRACT(Kernel::Object) BOOST_SERIALIZATION_ASSUME_ABSTRACT(Kernel::Object)
#define CONSTRUCT_KERNEL_OBJECT(T) \ #define CONSTRUCT_KERNEL_OBJECT(T) \
namespace boost::serialization { \ namespace boost::serialization { \
template<class Archive> \ template <class Archive> \
inline void load_construct_data( \ inline void load_construct_data(Archive& ar, T* t, const unsigned int file_version) { \
Archive & ar, T * t, const unsigned int file_version \ ::new (t) T(Core::Global<Kernel::KernelSystem>()); \
){ \ } \
::new(t)T(Core::Global<Kernel::KernelSystem>()); \ }
}}

View File

@ -11,6 +11,7 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/serialization/boost_vector.hpp" #include "common/serialization/boost_vector.hpp"
#include "core/global.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/memory.h" #include "core/hle/kernel/memory.h"
#include "core/hle/kernel/process.h" #include "core/hle/kernel/process.h"
@ -18,7 +19,6 @@
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/hle/kernel/vm_manager.h" #include "core/hle/kernel/vm_manager.h"
#include "core/memory.h" #include "core/memory.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::Process) SERIALIZE_EXPORT_IMPL(Kernel::Process)
SERIALIZE_EXPORT_IMPL(Kernel::CodeSet) SERIALIZE_EXPORT_IMPL(Kernel::CodeSet)
@ -26,24 +26,25 @@ SERIALIZE_EXPORT_IMPL(Kernel::CodeSet)
namespace Kernel { namespace Kernel {
template <class Archive> template <class Archive>
void Process::serialize(Archive& ar, const unsigned int file_version) void Process::serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); ar& handle_table;
ar & handle_table; ar& codeset;
ar & codeset; ar& resource_limit;
ar & resource_limit; ar& svc_access_mask;
ar & svc_access_mask; ar& handle_table_size;
ar & handle_table_size; ar&(boost::container::vector<
ar & (boost::container::vector<AddressMapping, boost::container::dtl::static_storage_allocator<AddressMapping, 8> >&)address_mappings; AddressMapping, boost::container::dtl::static_storage_allocator<AddressMapping, 8>>&)
ar & flags.raw; address_mappings;
ar & kernel_version; ar& flags.raw;
ar & ideal_processor; ar& kernel_version;
ar & status; ar& ideal_processor;
ar & process_id; ar& status;
ar & vm_manager; ar& process_id;
ar & memory_used; ar& vm_manager;
ar & memory_region; ar& memory_used;
ar & tls_slots; ar& memory_region;
ar& tls_slots;
} }
SERIALIZE_IMPL(Process) SERIALIZE_IMPL(Process)

View File

@ -11,8 +11,8 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/container/static_vector.hpp> #include <boost/container/static_vector.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/base_object.hpp> #include <boost/serialization/base_object.hpp>
#include <boost/serialization/vector.hpp>
#include "common/bit_field.h" #include "common/bit_field.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/handle_table.h"
@ -31,12 +31,11 @@ struct AddressMapping {
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& address;
ar & address; ar& size;
ar & size; ar& read_only;
ar & read_only; ar& unk_flag;
ar & unk_flag;
} }
}; };
@ -76,11 +75,10 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& offset;
ar & offset; ar& addr;
ar & addr; ar& size;
ar & size;
} }
}; };
@ -133,14 +131,13 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this);
// TODO: memory reference // TODO: memory reference
ar & segments; ar& segments;
ar & entrypoint; ar& entrypoint;
ar & name; ar& name;
ar & program_id; ar& program_id;
} }
}; };

View File

@ -116,30 +116,30 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); // NB most of these aren't used at all currently, but we're adding them here for forwards
// NB most of these aren't used at all currently, but we're adding them here for forwards compatibility // compatibility
ar & name; ar& name;
ar & max_priority; ar& max_priority;
ar & max_commit; ar& max_commit;
ar & max_threads; ar& max_threads;
ar & max_events; ar& max_events;
ar & max_mutexes; ar& max_mutexes;
ar & max_semaphores; ar& max_semaphores;
ar & max_timers; ar& max_timers;
ar & max_shared_mems; ar& max_shared_mems;
ar & max_address_arbiters; ar& max_address_arbiters;
ar & max_cpu_time; ar& max_cpu_time;
ar & current_commit; ar& current_commit;
ar & current_threads; ar& current_threads;
ar & current_events; ar& current_events;
ar & current_mutexes; ar& current_mutexes;
ar & current_semaphores; ar& current_semaphores;
ar & current_timers; ar& current_timers;
ar & current_shared_mems; ar& current_shared_mems;
ar & current_address_arbiters; ar& current_address_arbiters;
ar & current_cpu_time; ar& current_cpu_time;
} }
}; };
@ -160,9 +160,8 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& resource_limits;
ar & resource_limits;
} }
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/assert.h"
#include "common/archives.h" #include "common/archives.h"
#include "common/assert.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
#include "core/hle/kernel/semaphore.h" #include "core/hle/kernel/semaphore.h"

View File

@ -5,8 +5,8 @@
#pragma once #pragma once
#include <string> #include <string>
#include <queue>
#include <boost/serialization/export.hpp> #include <boost/serialization/export.hpp>
#include <queue>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/hle/kernel/object.h" #include "core/hle/kernel/object.h"
#include "core/hle/kernel/wait_object.h" #include "core/hle/kernel/wait_object.h"
@ -48,12 +48,11 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<WaitObject>(*this);
ar & boost::serialization::base_object<WaitObject>(*this); ar& max_count;
ar & max_count; ar& available_count;
ar & available_count; ar& name;
ar & name;
} }
}; };

View File

@ -7,11 +7,11 @@
#include "common/assert.h" #include "common/assert.h"
#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/object.h" #include "core/hle/kernel/object.h"
#include "core/hle/kernel/server_port.h" #include "core/hle/kernel/server_port.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/hle/kernel/hle_ipc.h"
SERIALIZE_EXPORT_IMPL(Kernel::ServerPort) SERIALIZE_EXPORT_IMPL(Kernel::ServerPort)
@ -53,12 +53,11 @@ KernelSystem::PortPair KernelSystem::CreatePortPair(u32 max_sessions, std::strin
} }
template <class Archive> template <class Archive>
void ServerPort::serialize(Archive& ar, const unsigned int file_version) void ServerPort::serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<WaitObject>(*this);
ar & boost::serialization::base_object<WaitObject>(*this); ar& name;
ar & name; ar& pending_sessions;
ar & pending_sessions; ar& hle_handler;
ar & hle_handler;
} }
SERIALIZE_IMPL(ServerPort) SERIALIZE_IMPL(ServerPort)

View File

@ -4,13 +4,13 @@
#include <tuple> #include <tuple>
#include "common/archives.h" #include "common/archives.h"
#include "core/global.h"
#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h" #include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/server_session.h" #include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/session.h" #include "core/hle/kernel/session.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::ServerSession) SERIALIZE_EXPORT_IMPL(Kernel::ServerSession)

View File

@ -110,15 +110,14 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); ar& name;
ar & name; ar& parent;
ar & parent; ar& hle_handler;
ar & hle_handler; ar& pending_requesting_threads;
ar & pending_requesting_threads; ar& currently_handling;
ar & currently_handling; ar& mapped_buffer_context;
ar & mapped_buffer_context;
} }
}; };

View File

@ -4,22 +4,21 @@
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/kernel/session.h"
#include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/client_port.h"
#include "core/hle/kernel/client_session.h"
#include "core/hle/kernel/hle_ipc.h" #include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/server_session.h"
#include "core/hle/kernel/session.h"
SERIALIZE_IMPL(Kernel::Session) SERIALIZE_IMPL(Kernel::Session)
namespace Kernel { namespace Kernel {
template <class Archive> template <class Archive>
void Session::serialize(Archive& ar, const unsigned int file_version) void Session::serialize(Archive& ar, const unsigned int file_version) {
{ ar& client;
ar & client; ar& server;
ar & server; ar& port;
ar & port;
} }
} // namespace Kernel } // namespace Kernel

View File

@ -5,11 +5,11 @@
#include <cstring> #include <cstring>
#include "common/archives.h" #include "common/archives.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/global.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/memory.h" #include "core/hle/kernel/memory.h"
#include "core/hle/kernel/shared_memory.h" #include "core/hle/kernel/shared_memory.h"
#include "core/memory.h" #include "core/memory.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::SharedMemory) SERIALIZE_EXPORT_IMPL(Kernel::SharedMemory)

View File

@ -107,17 +107,16 @@ private:
KernelSystem& kernel; KernelSystem& kernel;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& linear_heap_phys_offset;
ar & linear_heap_phys_offset;
// TODO: backing blocks u8* (this is always FCRAM I think) // TODO: backing blocks u8* (this is always FCRAM I think)
ar & size; ar& size;
ar & permissions; ar& permissions;
ar & other_permissions; ar& other_permissions;
ar & owner_process; ar& owner_process;
ar & base_address; ar& base_address;
ar & name; ar& name;
ar & *(reinterpret_cast<MemoryRegionInfo::IntervalSet::ImplSetT*>(&holding_memory)); ar&*(reinterpret_cast<MemoryRegionInfo::IntervalSet::ImplSetT*>(&holding_memory));
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -108,10 +108,9 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{
auto o_shared_page = boost::serialization::binary_object(&shared_page, sizeof(shared_page)); auto o_shared_page = boost::serialization::binary_object(&shared_page, sizeof(shared_page));
ar & o_shared_page; ar& o_shared_page;
} }
}; };

View File

@ -15,6 +15,7 @@
#include "core/arm/arm_interface.h" #include "core/arm/arm_interface.h"
#include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/armstate.h"
#include "core/core.h" #include "core/core.h"
#include "core/global.h"
#include "core/hle/kernel/errors.h" #include "core/hle/kernel/errors.h"
#include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/handle_table.h"
#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/kernel.h"
@ -24,31 +25,29 @@
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/memory.h" #include "core/memory.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::Thread) SERIALIZE_EXPORT_IMPL(Kernel::Thread)
namespace Kernel { namespace Kernel {
template <class Archive> template <class Archive>
void Thread::serialize(Archive& ar, const unsigned int file_version) void Thread::serialize(Archive& ar, const unsigned int file_version) {
{ ar&* context.get();
ar & *context.get(); ar& thread_id;
ar & thread_id; ar& status;
ar & status; ar& entry_point;
ar & entry_point; ar& stack_top;
ar & stack_top; ar& nominal_priority;
ar & nominal_priority; ar& current_priority;
ar & current_priority; ar& last_running_ticks;
ar & last_running_ticks; ar& processor_id;
ar & processor_id; ar& tls_address;
ar & tls_address; ar& held_mutexes;
ar & held_mutexes; ar& pending_mutexes;
ar & pending_mutexes; ar& owner_process;
ar & owner_process; ar& wait_objects;
ar & wait_objects; ar& wait_address;
ar & wait_address; ar& name;
ar & name;
// TODO: How the hell to do wakeup_callback // TODO: How the hell to do wakeup_callback
} }

View File

@ -9,10 +9,10 @@
#include <unordered_map> #include <unordered_map>
#include <vector> #include <vector>
#include <boost/container/flat_set.hpp> #include <boost/container/flat_set.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/unordered_map.hpp> #include <boost/serialization/unordered_map.hpp>
#include <boost/serialization/vector.hpp> #include <boost/serialization/vector.hpp>
#include <boost/serialization/export.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/thread_queue_list.h" #include "common/thread_queue_list.h"
#include "core/arm/arm_interface.h" #include "core/arm/arm_interface.h"
@ -152,13 +152,12 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& next_thread_id;
ar & next_thread_id; ar& current_thread;
ar & current_thread; ar& ready_queue;
ar & ready_queue; ar& wakeup_callback_table;
ar & wakeup_callback_table; ar& thread_list;
ar & thread_list;
} }
}; };

View File

@ -8,11 +8,11 @@
#include "common/assert.h" #include "common/assert.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/core.h" #include "core/core.h"
#include "core/global.h"
#include "core/hle/kernel/handle_table.h" #include "core/hle/kernel/handle_table.h"
#include "core/hle/kernel/object.h" #include "core/hle/kernel/object.h"
#include "core/hle/kernel/thread.h" #include "core/hle/kernel/thread.h"
#include "core/hle/kernel/timer.h" #include "core/hle/kernel/timer.h"
#include "core/global.h"
SERIALIZE_EXPORT_IMPL(Kernel::Timer) SERIALIZE_EXPORT_IMPL(Kernel::Timer)

View File

@ -37,10 +37,9 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& next_timer_callback_id;
ar & next_timer_callback_id; ar& timer_callback_table;
ar & timer_callback_table;
} }
}; };
@ -115,14 +114,13 @@ private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& reset_type;
ar & reset_type; ar& initial_delay;
ar & initial_delay; ar& interval_delay;
ar & interval_delay; ar& signaled;
ar & signaled; ar& name;
ar & name; ar& callback_id;
ar & callback_id;
} }
}; };

View File

@ -86,17 +86,16 @@ struct VirtualMemoryArea {
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& base;
ar & base; ar& size;
ar & size; ar& type;
ar & type; ar& permissions;
ar & permissions; ar& meminfo_state;
ar & meminfo_state;
// TODO: backing memory ref // TODO: backing memory ref
// backing memory can be: Physical/FCRAM pointer, config mem, shared page // backing memory can be: Physical/FCRAM pointer, config mem, shared page
ar & paddr; ar& paddr;
ar & mmio_handler; ar& mmio_handler;
} }
}; };
@ -213,27 +212,25 @@ public:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void save(Archive& ar, const unsigned int file_version) const void save(Archive& ar, const unsigned int file_version) const {
{ ar& vma_map;
ar & vma_map;
for (int i = 0; i < page_table.pointers.size(); i++) { for (int i = 0; i < page_table.pointers.size(); i++) {
ar << memory.GetFCRAMOffset(page_table.pointers[i]); ar << memory.GetFCRAMOffset(page_table.pointers[i]);
} }
ar & page_table.special_regions; ar& page_table.special_regions;
ar & page_table.attributes; ar& page_table.attributes;
} }
template <class Archive> template <class Archive>
void load(Archive& ar, const unsigned int file_version) void load(Archive& ar, const unsigned int file_version) {
{ ar& vma_map;
ar & vma_map;
for (int i = 0; i < page_table.pointers.size(); i++) { for (int i = 0; i < page_table.pointers.size(); i++) {
u32 offset{}; u32 offset{};
ar >> offset; ar >> offset;
page_table.pointers[i] = memory.GetFCRAMPointer(offset); page_table.pointers[i] = memory.GetFCRAMPointer(offset);
} }
ar & page_table.special_regions; ar& page_table.special_regions;
ar & page_table.attributes; ar& page_table.attributes;
} }
BOOST_SERIALIZATION_SPLIT_MEMBER() BOOST_SERIALIZATION_SPLIT_MEMBER()

View File

@ -69,10 +69,9 @@ private:
private: private:
friend class boost::serialization::access; friend class boost::serialization::access;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int file_version) void serialize(Archive& ar, const unsigned int file_version) {
{ ar& boost::serialization::base_object<Object>(*this);
ar & boost::serialization::base_object<Object>(*this); ar& waiting_threads;
ar & waiting_threads;
// NB: hle_notifier *not* serialized since it's a callback! // NB: hle_notifier *not* serialized since it's a callback!
// Fortunately it's only used in one place (DSP) so we can reconstruct it there // Fortunately it's only used in one place (DSP) so we can reconstruct it there
} }

View File

@ -3,9 +3,9 @@
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include <vector> #include <vector>
#include "common/archives.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/archives.h"
#include "core/core.h" #include "core/core.h"
#include "core/hle/ipc.h" #include "core/hle/ipc.h"
#include "core/hle/ipc_helpers.h" #include "core/hle/ipc_helpers.h"
@ -181,12 +181,11 @@ void InstallInterfaces(Core::System& system) {
} }
template <class Archive> template <class Archive>
void Module::serialize(Archive& ar, const unsigned int) void Module::serialize(Archive& ar, const unsigned int) {
{ ar& ac_connected;
ar & ac_connected; ar& close_event;
ar & close_event; ar& connect_event;
ar & connect_event; ar& disconnect_event;
ar & disconnect_event;
// default_config is never written to // default_config is never written to
} }

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/ac/ac_i.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/ac/ac_i.h"
namespace Service::AC { namespace Service::AC {

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/ac/ac_u.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/ac/ac_u.h"
namespace Service::AC { namespace Service::AC {

View File

@ -23,9 +23,10 @@ public:
protected: protected:
std::shared_ptr<Module> act; std::shared_ptr<Module> act;
}; };
private: private:
template <class Archive> template <class Archive>
inline void serialize(Archive& ar, const unsigned int file_version) { } inline void serialize(Archive& ar, const unsigned int file_version) {}
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/act/act_a.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/act/act_a.h"
namespace Service::ACT { namespace Service::ACT {

View File

@ -11,6 +11,7 @@ namespace Service::ACT {
class ACT_A final : public Module::Interface { class ACT_A final : public Module::Interface {
public: public:
explicit ACT_A(std::shared_ptr<Module> act); explicit ACT_A(std::shared_ptr<Module> act);
private: private:
SERVICE_SERIALIZATION(ACT_A, act, Module) SERVICE_SERIALIZATION(ACT_A, act, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/act/act_u.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/act/act_u.h"
namespace Service::ACT { namespace Service::ACT {

View File

@ -11,6 +11,7 @@ namespace Service::ACT {
class ACT_U final : public Module::Interface { class ACT_U final : public Module::Interface {
public: public:
explicit ACT_U(std::shared_ptr<Module> act); explicit ACT_U(std::shared_ptr<Module> act);
private: private:
SERVICE_SERIALIZATION(ACT_U, act, Module) SERVICE_SERIALIZATION(ACT_U, act, Module)
}; };

View File

@ -1455,7 +1455,7 @@ Module::Module(Core::System& system) : kernel(system.Kernel()) {
system_updater_mutex = system.Kernel().CreateMutex(false, "AM::SystemUpdaterMutex"); system_updater_mutex = system.Kernel().CreateMutex(false, "AM::SystemUpdaterMutex");
} }
Module::Module(Kernel::KernelSystem& kernel) : kernel(kernel) { } Module::Module(Kernel::KernelSystem& kernel) : kernel(kernel) {}
Module::~Module() = default; Module::~Module() = default;

View File

@ -10,15 +10,15 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <boost/serialization/array.hpp> #include <boost/serialization/array.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include <boost/serialization/vector.hpp>
#include "common/common_types.h" #include "common/common_types.h"
#include "core/file_sys/cia_container.h" #include "core/file_sys/cia_container.h"
#include "core/file_sys/file_backend.h" #include "core/file_sys/file_backend.h"
#include "core/global.h"
#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/mutex.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/global.h"
namespace Core { namespace Core {
class System; class System;
@ -585,11 +585,10 @@ private:
std::shared_ptr<Kernel::Mutex> system_updater_mutex; std::shared_ptr<Kernel::Mutex> system_updater_mutex;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& cia_installing;
ar & cia_installing; ar& am_title_list;
ar & am_title_list; ar& system_updater_mutex;
ar & system_updater_mutex;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -599,9 +598,8 @@ void InstallInterfaces(Core::System& system);
} // namespace Service::AM } // namespace Service::AM
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
inline void load_construct_data(Archive& ar, Service::AM::Module* t, const unsigned int) inline void load_construct_data(Archive& ar, Service::AM::Module* t, const unsigned int) {
{ ::new (t) Service::AM::Module(Core::Global<Kernel::KernelSystem>());
::new(t)Service::AM::Module(Core::Global<Kernel::KernelSystem>());
}
} }
} // namespace boost::serialization

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/am/am_app.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/am/am_app.h"
namespace Service::AM { namespace Service::AM {

View File

@ -11,6 +11,7 @@ namespace Service::AM {
class AM_APP final : public Module::Interface { class AM_APP final : public Module::Interface {
public: public:
explicit AM_APP(std::shared_ptr<Module> am); explicit AM_APP(std::shared_ptr<Module> am);
private: private:
SERVICE_SERIALIZATION(AM_APP, am, Module) SERVICE_SERIALIZATION(AM_APP, am, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/am/am_net.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/am/am_net.h"
namespace Service::AM { namespace Service::AM {

View File

@ -11,6 +11,7 @@ namespace Service::AM {
class AM_NET final : public Module::Interface { class AM_NET final : public Module::Interface {
public: public:
explicit AM_NET(std::shared_ptr<Module> am); explicit AM_NET(std::shared_ptr<Module> am);
private: private:
SERVICE_SERIALIZATION(AM_NET, am, Module) SERVICE_SERIALIZATION(AM_NET, am, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/am/am_sys.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/am/am_sys.h"
namespace Service::AM { namespace Service::AM {

View File

@ -11,6 +11,7 @@ namespace Service::AM {
class AM_SYS final : public Module::Interface { class AM_SYS final : public Module::Interface {
public: public:
explicit AM_SYS(std::shared_ptr<Module> am); explicit AM_SYS(std::shared_ptr<Module> am);
private: private:
SERVICE_SERIALIZATION(AM_SYS, am, Module) SERVICE_SERIALIZATION(AM_SYS, am, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/am/am_u.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/am/am_u.h"
namespace Service::AM { namespace Service::AM {

View File

@ -11,6 +11,7 @@ namespace Service::AM {
class AM_U final : public Module::Interface { class AM_U final : public Module::Interface {
public: public:
explicit AM_U(std::shared_ptr<Module> am); explicit AM_U(std::shared_ptr<Module> am);
private: private:
SERVICE_SERIALIZATION(AM_U, am, Module) SERVICE_SERIALIZATION(AM_U, am, Module)
}; };

View File

@ -10,10 +10,10 @@
#include <vector> #include <vector>
#include <boost/serialization/array.hpp> #include <boost/serialization/array.hpp>
#include "common/serialization/optional.h" #include "common/serialization/optional.h"
#include "core/global.h"
#include "core/hle/kernel/event.h" #include "core/hle/kernel/event.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/archive.h"
#include "core/global.h"
namespace Core { namespace Core {
class System; class System;
@ -90,13 +90,12 @@ struct MessageParameter {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& sender_id;
ar & sender_id; ar& destination_id;
ar & destination_id; ar& signal;
ar & signal; ar& object;
ar & object; ar& buffer;
ar & buffer;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -179,12 +178,11 @@ public:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& next_title_id;
ar & next_title_id; ar& next_media_type;
ar & next_media_type; ar& current_title_id;
ar & current_title_id; ar& current_media_type;
ar & current_media_type;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -228,16 +226,15 @@ private:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& applet_id;
ar & applet_id; ar& slot;
ar & slot; ar& title_id;
ar & title_id; ar& registered;
ar & registered; ar& loaded;
ar & loaded; ar& attributes.raw;
ar & attributes.raw; ar& notification_event;
ar & notification_event; ar& parameter_event;
ar & parameter_event;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -260,12 +257,11 @@ private:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& next_parameter;
ar & next_parameter; ar& app_jump_parameters;
ar & app_jump_parameters; ar& applet_slots;
ar & applet_slots; ar& library_applet_closing_command;
ar & library_applet_closing_command;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -273,9 +269,8 @@ private:
} // namespace Service::APT } // namespace Service::APT
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
inline void load_construct_data(Archive& ar, Service::APT::AppletManager* t, const unsigned int) inline void load_construct_data(Archive& ar, Service::APT::AppletManager* t, const unsigned int) {
{ ::new (t) Service::APT::AppletManager(Core::Global<Core::System>());
::new(t)Service::APT::AppletManager(Core::Global<Core::System>());
}
} }
} // namespace boost::serialization

View File

@ -2,10 +2,10 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "common/common_paths.h" #include "common/common_paths.h"
#include "common/file_util.h" #include "common/file_util.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "common/archives.h"
#include "core/core.h" #include "core/core.h"
#include "core/file_sys/archive_ncch.h" #include "core/file_sys/archive_ncch.h"
#include "core/file_sys/file_backend.h" #include "core/file_sys/file_backend.h"
@ -32,17 +32,16 @@ SERVICE_CONSTRUCT_IMPL(Service::APT::Module)
namespace Service::APT { namespace Service::APT {
template <class Archive> template <class Archive>
void Module::serialize(Archive& ar, const unsigned int) void Module::serialize(Archive& ar, const unsigned int) {
{ ar& shared_font_mem;
ar & shared_font_mem; ar& shared_font_loaded;
ar & shared_font_loaded; ar& shared_font_relocated;
ar & shared_font_relocated; ar& lock;
ar & lock; ar& cpu_percent;
ar & cpu_percent; ar& unknown_ns_state_field;
ar & unknown_ns_state_field; ar& screen_capture_buffer;
ar & screen_capture_buffer; ar& screen_capture_post_permission;
ar & screen_capture_post_permission; ar& applet_manager;
ar & applet_manager;
} }
SERIALIZE_IMPL(Module) SERIALIZE_IMPL(Module)

View File

@ -12,10 +12,9 @@
#include "common/common_funcs.h" #include "common/common_funcs.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/swap.h" #include "common/swap.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/apt/applet_manager.h"
#include "core/hle/service/service.h"
#include "core/global.h" #include "core/global.h"
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/service.h"
namespace Core { namespace Core {
class System; class System;
@ -612,9 +611,8 @@ public:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& application_reset_prepared;
ar & application_reset_prepared;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -654,6 +652,6 @@ void InstallInterfaces(Core::System& system);
} // namespace Service::APT } // namespace Service::APT
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
void load_construct_data(Archive& ar, Service::APT::Module* t, const unsigned int); void load_construct_data(Archive& ar, Service::APT::Module* t, const unsigned int);
} }

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/apt_a.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/apt/apt_a.h"
namespace Service::APT { namespace Service::APT {

View File

@ -11,6 +11,7 @@ namespace Service::APT {
class APT_A final : public Module::APTInterface { class APT_A final : public Module::APTInterface {
public: public:
explicit APT_A(std::shared_ptr<Module> apt); explicit APT_A(std::shared_ptr<Module> apt);
private: private:
SERVICE_SERIALIZATION(APT_A, apt, Module) SERVICE_SERIALIZATION(APT_A, apt, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/apt_s.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/apt/apt_s.h"
namespace Service::APT { namespace Service::APT {

View File

@ -18,6 +18,7 @@ namespace Service::APT {
class APT_S final : public Module::APTInterface { class APT_S final : public Module::APTInterface {
public: public:
explicit APT_S(std::shared_ptr<Module> apt); explicit APT_S(std::shared_ptr<Module> apt);
private: private:
SERVICE_SERIALIZATION(APT_S, apt, Module) SERVICE_SERIALIZATION(APT_S, apt, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/apt_u.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/apt/apt_u.h"
namespace Service::APT { namespace Service::APT {

View File

@ -18,6 +18,7 @@ namespace Service::APT {
class APT_U final : public Module::APTInterface { class APT_U final : public Module::APTInterface {
public: public:
explicit APT_U(std::shared_ptr<Module> apt); explicit APT_U(std::shared_ptr<Module> apt);
private: private:
SERVICE_SERIALIZATION(APT_U, apt, Module) SERVICE_SERIALIZATION(APT_U, apt, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/apt/ns_s.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/apt/ns_s.h"
namespace Service::NS { namespace Service::NS {

View File

@ -14,6 +14,7 @@ namespace Service::NS {
class NS_S final : public Service::APT::Module::NSInterface { class NS_S final : public Service::APT::Module::NSInterface {
public: public:
explicit NS_S(std::shared_ptr<Service::APT::Module> apt); explicit NS_S(std::shared_ptr<Service::APT::Module> apt);
private: private:
SERVICE_SERIALIZATION(NS_S, apt, Service::APT::Module) SERVICE_SERIALIZATION(NS_S, apt, Service::APT::Module)
}; };

View File

@ -6,9 +6,9 @@
#include <memory> #include <memory>
#include <boost/serialization/shared_ptr.hpp> #include <boost/serialization/shared_ptr.hpp>
#include "core/global.h"
#include "core/hle/kernel/event.h" #include "core/hle/kernel/event.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/global.h"
namespace Core { namespace Core {
class System; class System;
@ -964,12 +964,11 @@ public:
u8 output_flag; u8 output_flag;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& new_arrival_flag;
ar & new_arrival_flag; ar& ns_data_new_flag;
ar & ns_data_new_flag; ar& ns_data_new_flag_privileged;
ar & ns_data_new_flag_privileged; ar& output_flag;
ar & output_flag;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -978,9 +977,8 @@ private:
std::shared_ptr<Kernel::Event> task_finish_event; std::shared_ptr<Kernel::Event> task_finish_event;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& task_finish_event;
ar & task_finish_event;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -990,9 +988,8 @@ void InstallInterfaces(Core::System& system);
} // namespace Service::BOSS } // namespace Service::BOSS
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
inline void load_construct_data(Archive& ar, Service::BOSS::Module* t, const unsigned int) inline void load_construct_data(Archive& ar, Service::BOSS::Module* t, const unsigned int) {
{ ::new (t) Service::BOSS::Module(Core::Global<Core::System>());
::new(t)Service::BOSS::Module(Core::Global<Core::System>());
}
} }
} // namespace boost::serialization

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/boss/boss_p.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/boss/boss_p.h"
namespace Service::BOSS { namespace Service::BOSS {

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/boss/boss_u.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/boss/boss_u.h"
namespace Service::BOSS { namespace Service::BOSS {

View File

@ -24,11 +24,10 @@
namespace Service::CAM { namespace Service::CAM {
template <class Archive> template <class Archive>
void Module::serialize(Archive& ar, const unsigned int) void Module::serialize(Archive& ar, const unsigned int) {
{ ar& cameras;
ar & cameras; ar& ports;
ar & ports; ar& is_camera_reload_pending;
ar & is_camera_reload_pending;
} }
SERIALIZE_IMPL(Module) SERIALIZE_IMPL(Module)

View File

@ -10,9 +10,9 @@
#include <vector> #include <vector>
#include "common/common_types.h" #include "common/common_types.h"
#include "common/swap.h" #include "common/swap.h"
#include "core/global.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/service.h" #include "core/hle/service/service.h"
#include "core/global.h"
namespace Core { namespace Core {
class System; class System;
@ -183,14 +183,13 @@ struct Resolution {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& width;
ar & width; ar& height;
ar & height; ar& crop_x0;
ar & crop_x0; ar& crop_y0;
ar & crop_y0; ar& crop_x1;
ar & crop_x1; ar& crop_y1;
ar & crop_y1;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -755,12 +754,11 @@ private:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& flip;
ar & flip; ar& effect;
ar & effect; ar& format;
ar & format; ar& resolution;
ar & resolution;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -773,12 +771,11 @@ private:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& impl;
ar & impl; ar& contexts;
ar & contexts; ar& current_context;
ar & current_context; ar& frame_rate;
ar & frame_rate;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -818,27 +815,26 @@ private:
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& camera_id;
ar & camera_id; ar& is_active;
ar & is_active; ar& is_pending_receiving;
ar & is_pending_receiving; ar& is_busy;
ar & is_busy; ar& is_receiving;
ar & is_receiving; ar& is_trimming;
ar & is_trimming; ar& x0;
ar & x0; ar& y0;
ar & y0; ar& x1;
ar & x1; ar& y1;
ar & y1; ar& transfer_bytes;
ar & transfer_bytes; ar& completion_event;
ar & completion_event; ar& buffer_error_interrupt_event;
ar & buffer_error_interrupt_event; ar& vsync_interrupt_event;
ar & vsync_interrupt_event;
// TODO: Check if this is ever needed: // TODO: Check if this is ever needed:
//ar & capture_result; // ar & capture_result;
ar & dest_process; ar& dest_process;
ar & dest; ar& dest;
ar & dest_size; ar& dest_size;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -864,9 +860,8 @@ void InstallInterfaces(Core::System& system);
} // namespace Service::CAM } // namespace Service::CAM
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
inline void load_construct_data(Archive& ar, Service::CAM::Module* t, const unsigned int) inline void load_construct_data(Archive& ar, Service::CAM::Module* t, const unsigned int) {
{ ::new (t) Service::CAM::Module(Core::Global<Core::System>());
::new(t)Service::CAM::Module(Core::Global<Core::System>());
}
} }
} // namespace boost::serialization

View File

@ -2,9 +2,9 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/cam/cam.h" #include "core/hle/service/cam/cam.h"
#include "core/hle/service/cam/cam_c.h" #include "core/hle/service/cam/cam_c.h"
#include "common/archives.h"
namespace Service::CAM { namespace Service::CAM {

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/cam/cam_q.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/cam/cam_q.h"
namespace Service::CAM { namespace Service::CAM {

View File

@ -11,11 +11,11 @@ namespace Service::CAM {
class CAM_Q : public ServiceFramework<CAM_Q> { class CAM_Q : public ServiceFramework<CAM_Q> {
public: public:
CAM_Q(); CAM_Q();
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -2,9 +2,9 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/cam/cam.h" #include "core/hle/service/cam/cam.h"
#include "core/hle/service/cam/cam_s.h" #include "core/hle/service/cam/cam_s.h"
#include "common/archives.h"
namespace Service::CAM { namespace Service::CAM {

View File

@ -2,9 +2,9 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/cam/cam.h" #include "core/hle/service/cam/cam.h"
#include "core/hle/service/cam/cam_u.h" #include "core/hle/service/cam/cam_u.h"
#include "common/archives.h"
namespace Service::CAM { namespace Service::CAM {

View File

@ -38,10 +38,9 @@ struct AdpcmState {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& predictor;
ar & predictor; ar& step_index;
ar & step_index;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -66,24 +65,23 @@ struct Channel {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& block1_address;
ar & block1_address; ar& block2_address;
ar & block2_address; ar& block1_size;
ar & block1_size; ar& block2_size;
ar & block2_size; ar& block1_adpcm_state;
ar & block1_adpcm_state; ar& block2_adpcm_state;
ar & block2_adpcm_state; ar& block2_adpcm_reload;
ar & block2_adpcm_reload; ar& left_channel_volume;
ar & left_channel_volume; ar& right_channel_volume;
ar & right_channel_volume; ar& left_capture_volume;
ar & left_capture_volume; ar& right_capture_volume;
ar & right_capture_volume; ar& sample_rate;
ar & sample_rate; ar& linear_interpolation;
ar & linear_interpolation; ar& loop_mode;
ar & loop_mode; ar& encoding;
ar & encoding; ar& psg_duty;
ar & psg_duty;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -258,18 +256,17 @@ private:
u32 acquired_channel_mask = 0; u32 acquired_channel_mask = 0;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this); ar& mutex;
ar & mutex; ar& shared_memory;
ar & shared_memory; ar& capture_units;
ar & capture_units; ar& channels;
ar & channels; ar& master_state_offset;
ar & master_state_offset; ar& channel_state_offset;
ar & channel_state_offset; ar& capture_state_offset;
ar & capture_state_offset; ar& type1_command_offset;
ar & type1_command_offset; ar& acquired_channel_mask;
ar & acquired_channel_mask;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -282,6 +279,6 @@ void InstallInterfaces(Core::System& system);
BOOST_CLASS_EXPORT_KEY(Service::CSND::CSND_SND) BOOST_CLASS_EXPORT_KEY(Service::CSND::CSND_SND)
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
void load_construct_data(Archive& ar, Service::CSND::CSND_SND* t, const unsigned int); void load_construct_data(Archive& ar, Service::CSND::CSND_SND* t, const unsigned int);
} }

View File

@ -2,9 +2,9 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/ipc_helpers.h" #include "core/hle/ipc_helpers.h"
#include "core/hle/service/dlp/dlp_clnt.h" #include "core/hle/service/dlp/dlp_clnt.h"
#include "common/archives.h"
SERIALIZE_EXPORT_IMPL(Service::DLP::DLP_CLNT) SERIALIZE_EXPORT_IMPL(Service::DLP::DLP_CLNT)

View File

@ -12,11 +12,11 @@ class DLP_CLNT final : public ServiceFramework<DLP_CLNT> {
public: public:
DLP_CLNT(); DLP_CLNT();
~DLP_CLNT() = default; ~DLP_CLNT() = default;
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -2,9 +2,9 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/ipc_helpers.h" #include "core/hle/ipc_helpers.h"
#include "core/hle/service/dlp/dlp_fkcl.h" #include "core/hle/service/dlp/dlp_fkcl.h"
#include "common/archives.h"
SERIALIZE_EXPORT_IMPL(Service::DLP::DLP_FKCL) SERIALIZE_EXPORT_IMPL(Service::DLP::DLP_FKCL)

View File

@ -12,11 +12,11 @@ class DLP_FKCL final : public ServiceFramework<DLP_FKCL> {
public: public:
DLP_FKCL(); DLP_FKCL();
~DLP_FKCL() = default; ~DLP_FKCL() = default;
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -2,12 +2,12 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "common/archives.h"
#include "common/common_types.h" #include "common/common_types.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/hle/ipc_helpers.h" #include "core/hle/ipc_helpers.h"
#include "core/hle/result.h" #include "core/hle/result.h"
#include "core/hle/service/dlp/dlp_srvr.h" #include "core/hle/service/dlp/dlp_srvr.h"
#include "common/archives.h"
SERIALIZE_EXPORT_IMPL(Service::DLP::DLP_SRVR) SERIALIZE_EXPORT_IMPL(Service::DLP::DLP_SRVR)

View File

@ -17,9 +17,8 @@ private:
void IsChild(Kernel::HLERequestContext& ctx); void IsChild(Kernel::HLERequestContext& ctx);
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -266,14 +266,13 @@ private:
std::array<std::shared_ptr<Kernel::Event>, AudioCore::num_dsp_pipe> pipes = {{}}; std::array<std::shared_ptr<Kernel::Event>, AudioCore::num_dsp_pipe> pipes = {{}};
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this); ar& semaphore_event;
ar & semaphore_event; ar& preset_semaphore;
ar & preset_semaphore; ar& interrupt_zero;
ar & interrupt_zero; ar& interrupt_one;
ar & interrupt_one; ar& pipes;
ar & pipes;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -285,6 +284,6 @@ void InstallInterfaces(Core::System& system);
BOOST_CLASS_EXPORT_KEY(Service::DSP::DSP_DSP) BOOST_CLASS_EXPORT_KEY(Service::DSP::DSP_DSP)
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int); void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int);
} }

View File

@ -20,16 +20,15 @@
SERIALIZE_EXPORT_IMPL(Service::ERR::ERR_F) SERIALIZE_EXPORT_IMPL(Service::ERR::ERR_F)
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
void load_construct_data(Archive& ar, Service::ERR::ERR_F* t, const unsigned int) void load_construct_data(Archive& ar, Service::ERR::ERR_F* t, const unsigned int) {
{ ::new (t) Service::ERR::ERR_F(Core::Global<Core::System>());
::new(t)Service::ERR::ERR_F(Core::Global<Core::System>());
}
template
void load_construct_data<iarchive>(iarchive& ar, Service::ERR::ERR_F* t, const unsigned int);
} }
template void load_construct_data<iarchive>(iarchive& ar, Service::ERR::ERR_F* t,
const unsigned int);
} // namespace boost::serialization
namespace Service::ERR { namespace Service::ERR {
enum class FatalErrType : u32 { enum class FatalErrType : u32 {

View File

@ -36,9 +36,8 @@ private:
Core::System& system; Core::System& system;
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -50,6 +49,6 @@ void InstallInterfaces(Core::System& system);
BOOST_CLASS_EXPORT_KEY(Service::ERR::ERR_F) BOOST_CLASS_EXPORT_KEY(Service::ERR::ERR_F)
namespace boost::serialization { namespace boost::serialization {
template <class Archive> template <class Archive>
void load_construct_data(Archive& ar, Service::ERR::ERR_F* t, const unsigned int); void load_construct_data(Archive& ar, Service::ERR::ERR_F* t, const unsigned int);
} }

View File

@ -21,11 +21,10 @@ struct FriendKey {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& friend_id;
ar & friend_id; ar& unknown;
ar & unknown; ar& friend_code;
ar & friend_code;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -35,9 +34,8 @@ struct MyPresence {
private: private:
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& unknown;
ar & unknown;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };
@ -157,10 +155,9 @@ private:
MyPresence my_presence = {}; MyPresence my_presence = {};
template <class Archive> template <class Archive>
void serialize(Archive& ar, const unsigned int) void serialize(Archive& ar, const unsigned int) {
{ ar& my_friend_key;
ar & my_friend_key; ar& my_presence;
ar & my_presence;
} }
friend class boost::serialization::access; friend class boost::serialization::access;
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/frd/frd_a.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/frd/frd_a.h"
SERIALIZE_EXPORT_IMPL(Service::FRD::FRD_A) SERIALIZE_EXPORT_IMPL(Service::FRD::FRD_A)

View File

@ -11,6 +11,7 @@ namespace Service::FRD {
class FRD_A final : public Module::Interface { class FRD_A final : public Module::Interface {
public: public:
explicit FRD_A(std::shared_ptr<Module> frd); explicit FRD_A(std::shared_ptr<Module> frd);
private: private:
SERVICE_SERIALIZATION(FRD_A, frd, Module) SERVICE_SERIALIZATION(FRD_A, frd, Module)
}; };

View File

@ -2,8 +2,8 @@
// Licensed under GPLv2 or any later version // Licensed under GPLv2 or any later version
// Refer to the license.txt file included. // Refer to the license.txt file included.
#include "core/hle/service/frd/frd_u.h"
#include "common/archives.h" #include "common/archives.h"
#include "core/hle/service/frd/frd_u.h"
SERIALIZE_EXPORT_IMPL(Service::FRD::FRD_U) SERIALIZE_EXPORT_IMPL(Service::FRD::FRD_U)

View File

@ -11,6 +11,7 @@ namespace Service::FRD {
class FRD_U final : public Module::Interface { class FRD_U final : public Module::Interface {
public: public:
explicit FRD_U(std::shared_ptr<Module> frd); explicit FRD_U(std::shared_ptr<Module> frd);
private: private:
SERVICE_SERIALIZATION(FRD_U, frd, Module) SERVICE_SERIALIZATION(FRD_U, frd, Module)
}; };

Some files were not shown because too many files have changed in this diff Show More