Serialize CECD, CFG services

This commit is contained in:
Hamish Milne
2020-01-02 00:45:58 +00:00
committed by zhupengfei
parent ef2e503281
commit 2d2c7218ef
23 changed files with 135 additions and 16 deletions

View File

@@ -5,6 +5,7 @@
#include <cryptopp/base64.h>
#include <cryptopp/hmac.h>
#include <cryptopp/sha.h>
#include "common/archives.h"
#include "common/common_paths.h"
#include "common/file_util.h"
#include "common/logging/log.h"
@@ -24,8 +25,19 @@
#include "core/hle/service/cfg/cfg.h"
#include "fmt/format.h"
SERVICE_CONSTRUCT_IMPL(Service::CECD::Module)
SERIALIZE_EXPORT_IMPL(Service::CECD::Module)
namespace Service::CECD {
template <class Archive>
void Module::serialize(Archive& ar, const unsigned int) {
ar& cecd_system_save_data_archive;
ar& cecinfo_event;
ar& change_state_event;
}
SERIALIZE_IMPL(Module)
using CecDataPathType = Module::CecDataPathType;
using CecOpenMode = Module::CecOpenMode;
using CecSystemInfoType = Module::CecSystemInfoType;
@@ -1340,7 +1352,8 @@ void Module::CheckAndUpdateFile(const CecDataPathType path_type, const u32 ncch_
case CecDataPathType::MboxData:
case CecDataPathType::MboxIcon:
case CecDataPathType::MboxTitle:
default: {}
default: {
}
}
}

View File

@@ -584,7 +584,7 @@ public:
*/
void GetCecInfoEventHandleSys(Kernel::HLERequestContext& ctx);
private:
protected:
std::shared_ptr<Module> cecd;
};
@@ -613,9 +613,16 @@ private:
std::shared_ptr<Kernel::Event> change_state_event;
Core::System& system;
template <class Archive>
void serialize(Archive& ar, const unsigned int);
friend class boost::serialization::access;
};
/// Initialize CECD service(s)
void InstallInterfaces(Core::System& system);
} // namespace Service::CECD
SERVICE_CONSTRUCT(Service::CECD::Module)
BOOST_CLASS_EXPORT_KEY(Service::CECD::Module)

View File

@@ -2,8 +2,11 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/cecd/cecd_ndm.h"
SERIALIZE_EXPORT_IMPL(Service::CECD::CECD_NDM)
namespace Service::CECD {
CECD_NDM::CECD_NDM(std::shared_ptr<Module> cecd)

View File

@@ -11,6 +11,12 @@ namespace Service::CECD {
class CECD_NDM final : public Module::Interface {
public:
explicit CECD_NDM(std::shared_ptr<Module> cecd);
private:
SERVICE_SERIALIZATION(CECD_NDM, cecd, Module)
};
} // namespace Service::CECD
BOOST_CLASS_EXPORT_KEY(Service::CECD::CECD_NDM)
BOOST_SERIALIZATION_CONSTRUCT(Service::CECD::CECD_NDM)

View File

@@ -2,8 +2,11 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/cecd/cecd_s.h"
SERIALIZE_EXPORT_IMPL(Service::CECD::CECD_S)
namespace Service::CECD {
CECD_S::CECD_S(std::shared_ptr<Module> cecd)

View File

@@ -11,6 +11,12 @@ namespace Service::CECD {
class CECD_S final : public Module::Interface {
public:
explicit CECD_S(std::shared_ptr<Module> cecd);
private:
SERVICE_SERIALIZATION(CECD_S, cecd, Module)
};
} // namespace Service::CECD
BOOST_CLASS_EXPORT_KEY(Service::CECD::CECD_S)
BOOST_SERIALIZATION_CONSTRUCT(Service::CECD::CECD_S)

View File

@@ -2,8 +2,11 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/archives.h"
#include "core/hle/service/cecd/cecd_u.h"
SERIALIZE_EXPORT_IMPL(Service::CECD::CECD_U)
namespace Service::CECD {
CECD_U::CECD_U(std::shared_ptr<Module> cecd)

View File

@@ -11,6 +11,12 @@ namespace Service::CECD {
class CECD_U final : public Module::Interface {
public:
explicit CECD_U(std::shared_ptr<Module> cecd);
private:
SERVICE_SERIALIZATION(CECD_U, cecd, Module)
};
} // namespace Service::CECD
BOOST_CLASS_EXPORT_KEY(Service::CECD::CECD_U)
BOOST_SERIALIZATION_CONSTRUCT(Service::CECD::CECD_U)