Correct exports; add some file serialization; fix service base object serialization
This commit is contained in:
parent
f2de70c3fb
commit
996aba39fe
52 changed files with 197 additions and 33 deletions
|
@ -80,6 +80,8 @@ public:
|
|||
static constexpr u64 IPCDelayNanoseconds(3085068);
|
||||
return IPCDelayNanoseconds;
|
||||
}
|
||||
|
||||
SERIALIZE_DELAY_GENERATOR
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -300,3 +302,5 @@ void ArchiveFactory_ExtSaveData::WriteIcon(const Path& path, const u8* icon_data
|
|||
}
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
SERIALIZE_EXPORT_IMPL(FileSys::ExtSaveDataDelayGenerator)
|
||||
|
|
|
@ -103,6 +103,9 @@ std::string GetExtDataContainerPath(const std::string& mount_point, bool shared)
|
|||
*/
|
||||
Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low);
|
||||
|
||||
class ExtSaveDataDelayGenerator;
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_ExtSaveData)
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::ExtSaveDataDelayGenerator)
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
static constexpr u64 IPCDelayNanoseconds(269082);
|
||||
return IPCDelayNanoseconds;
|
||||
}
|
||||
|
||||
SERIALIZE_DELAY_GENERATOR
|
||||
};
|
||||
|
||||
ResultVal<std::unique_ptr<FileBackend>> SDMCArchive::OpenFile(const Path& path,
|
||||
|
@ -409,3 +411,5 @@ ResultVal<ArchiveFormatInfo> ArchiveFactory_SDMC::GetFormatInfo(const Path& path
|
|||
return ResultCode(-1);
|
||||
}
|
||||
} // namespace FileSys
|
||||
|
||||
SERIALIZE_EXPORT_IMPL(FileSys::SDMCDelayGenerator)
|
||||
|
|
|
@ -86,7 +86,10 @@ private:
|
|||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
class SDMCDelayGenerator;
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::SDMCArchive)
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_SDMC)
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::SDMCDelayGenerator)
|
||||
|
|
|
@ -39,6 +39,8 @@ public:
|
|||
static constexpr u64 IPCDelayNanoseconds(269082);
|
||||
return IPCDelayNanoseconds;
|
||||
}
|
||||
|
||||
SERIALIZE_DELAY_GENERATOR
|
||||
};
|
||||
|
||||
ResultVal<std::unique_ptr<FileBackend>> SDMCWriteOnlyArchive::OpenFile(const Path& path,
|
||||
|
@ -100,3 +102,5 @@ ResultVal<ArchiveFormatInfo> ArchiveFactory_SDMCWriteOnly::GetFormatInfo(const P
|
|||
}
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
SERIALIZE_EXPORT_IMPL(FileSys::SDMCWriteOnlyDelayGenerator)
|
||||
|
|
|
@ -72,7 +72,10 @@ private:
|
|||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
class SDMCWriteOnlyDelayGenerator;
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::SDMCWriteOnlyArchive)
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::ArchiveFactory_SDMCWriteOnly)
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::SDMCWriteOnlyDelayGenerator)
|
||||
|
|
|
@ -5,10 +5,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/serialization/access.hpp>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/export.hpp>
|
||||
#include "common/common_types.h"
|
||||
|
||||
#define SERIALIZE_DELAY_GENERATOR \
|
||||
private: \
|
||||
template <class Archive> \
|
||||
void serialize(Archive& ar, const unsigned int) { \
|
||||
ar& boost::serialization::base_object<DelayGenerator>(*this); \
|
||||
} \
|
||||
friend class boost::serialization::access;
|
||||
|
||||
namespace FileSys {
|
||||
|
||||
class DelayGenerator {
|
||||
|
@ -28,6 +36,8 @@ class DefaultDelayGenerator : public DelayGenerator {
|
|||
public:
|
||||
u64 GetReadDelayNs(std::size_t length) override;
|
||||
u64 GetOpenDelayNs() override;
|
||||
|
||||
SERIALIZE_DELAY_GENERATOR
|
||||
};
|
||||
|
||||
} // namespace FileSys
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/unique_ptr.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "common/file_util.h"
|
||||
#include "core/file_sys/archive_backend.h"
|
||||
|
@ -43,6 +45,13 @@ public:
|
|||
protected:
|
||||
Mode mode;
|
||||
std::unique_ptr<FileUtil::IOFile> file;
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<FileBackend>(*this);
|
||||
ar& mode;
|
||||
ar& file;
|
||||
}
|
||||
};
|
||||
|
||||
class DiskDirectory : public DirectoryBackend {
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/serialization/unique_ptr.hpp>
|
||||
#include "common/common_types.h"
|
||||
#include "core/hle/result.h"
|
||||
#include "delay_generator.h"
|
||||
|
@ -90,6 +92,12 @@ public:
|
|||
|
||||
protected:
|
||||
std::unique_ptr<DelayGenerator> delay_generator;
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& delay_generator;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
} // namespace FileSys
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include "common/archives.h"
|
||||
#include "common/file_util.h"
|
||||
#include "core/file_sys/disk_archive.h"
|
||||
#include "core/file_sys/errors.h"
|
||||
|
@ -33,6 +34,8 @@ public:
|
|||
static constexpr u64 IPCDelayNanoseconds(269082);
|
||||
return IPCDelayNanoseconds;
|
||||
}
|
||||
|
||||
SERIALIZE_DELAY_GENERATOR
|
||||
};
|
||||
|
||||
ResultVal<std::unique_ptr<FileBackend>> SaveDataArchive::OpenFile(const Path& path,
|
||||
|
@ -353,3 +356,5 @@ u64 SaveDataArchive::GetFreeBytes() const {
|
|||
}
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
SERIALIZE_EXPORT_IMPL(FileSys::SaveDataDelayGenerator)
|
||||
|
|
|
@ -40,4 +40,8 @@ protected:
|
|||
std::string mount_point;
|
||||
};
|
||||
|
||||
class SaveDataDelayGenerator;
|
||||
|
||||
} // namespace FileSys
|
||||
|
||||
BOOST_CLASS_EXPORT_KEY(FileSys::SaveDataDelayGenerator)
|
||||
|
|
|
@ -13,11 +13,7 @@ public:
|
|||
CAM_Q();
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::CAM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::CFG {
|
|||
class CFG_NOR final : public ServiceFramework<CFG_NOR> {
|
||||
public:
|
||||
CFG_NOR();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::CFG
|
||||
|
|
|
@ -14,11 +14,7 @@ public:
|
|||
~DLP_CLNT() = default;
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::DLP
|
||||
|
|
|
@ -14,11 +14,7 @@ public:
|
|||
~DLP_FKCL() = default;
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::DLP
|
||||
|
|
|
@ -16,11 +16,7 @@ public:
|
|||
private:
|
||||
void IsChild(Kernel::HLERequestContext& ctx);
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::DLP
|
||||
|
|
|
@ -35,11 +35,7 @@ private:
|
|||
|
||||
Core::System& system;
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
|
|
@ -19,6 +19,17 @@ struct FileSessionSlot : public Kernel::SessionRequestHandler::SessionDataBase {
|
|||
u64 offset; ///< Offset that this session will start reading from.
|
||||
u64 size; ///< Max size of the file that this session is allowed to access
|
||||
bool subfile; ///< Whether this file was opened via OpenSubFile or not.
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler::SessionDataBase>(
|
||||
*this);
|
||||
ar& priority;
|
||||
ar& offset;
|
||||
ar& size;
|
||||
ar& subfile;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: File is not a real service, but it can still utilize ServiceFramework::RegisterHandlers.
|
||||
|
|
|
@ -26,6 +26,8 @@ struct ClientSlot : public Kernel::SessionRequestHandler::SessionDataBase {
|
|||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler::SessionDataBase>(
|
||||
*this);
|
||||
ar& program_id;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
|
|
|
@ -203,6 +203,8 @@ public:
|
|||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler::SessionDataBase>(
|
||||
*this);
|
||||
ar& gsp;
|
||||
ar& interrupt_event;
|
||||
ar& thread_id;
|
||||
|
|
|
@ -240,6 +240,8 @@ struct SessionData : public Kernel::SessionRequestHandler::SessionDataBase {
|
|||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler::SessionDataBase>(
|
||||
*this);
|
||||
ar& current_http_context;
|
||||
ar& session_id;
|
||||
ar& num_http_contexts;
|
||||
|
|
|
@ -18,6 +18,8 @@ struct ClientSlot : public Kernel::SessionRequestHandler::SessionDataBase {
|
|||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler::SessionDataBase>(
|
||||
*this);
|
||||
ar& loaded_crs;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Service::MIC {
|
|||
|
||||
template <class Archive>
|
||||
void MIC_U::serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
ar&* impl.get();
|
||||
}
|
||||
SERIALIZE_IMPL(MIC_U)
|
||||
|
|
|
@ -14,11 +14,7 @@ public:
|
|||
~MVD_STD() = default;
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::MVD
|
||||
|
|
|
@ -24,6 +24,8 @@ private:
|
|||
* 2 : Number of notifications
|
||||
*/
|
||||
void GetTotalNotifications(Kernel::HLERequestContext& ctx);
|
||||
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NEWS
|
||||
|
|
|
@ -12,6 +12,9 @@ namespace Service::NEWS {
|
|||
class NEWS_U final : public ServiceFramework<NEWS_U> {
|
||||
public:
|
||||
NEWS_U();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NEWS
|
||||
|
|
|
@ -12,6 +12,9 @@ class NIM_AOC final : public ServiceFramework<NIM_AOC> {
|
|||
public:
|
||||
NIM_AOC();
|
||||
~NIM_AOC();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NIM
|
||||
|
|
|
@ -12,6 +12,9 @@ class NIM_S final : public ServiceFramework<NIM_S> {
|
|||
public:
|
||||
NIM_S();
|
||||
~NIM_S();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NIM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::NWM {
|
|||
class NWM_CEC final : public ServiceFramework<NWM_CEC> {
|
||||
public:
|
||||
NWM_CEC();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::NWM {
|
|||
class NWM_EXT final : public ServiceFramework<NWM_EXT> {
|
||||
public:
|
||||
NWM_EXT();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::NWM {
|
|||
class NWM_INF final : public ServiceFramework<NWM_INF> {
|
||||
public:
|
||||
NWM_INF();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::NWM {
|
|||
class NWM_SAP final : public ServiceFramework<NWM_SAP> {
|
||||
public:
|
||||
NWM_SAP();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::NWM {
|
|||
class NWM_SOC final : public ServiceFramework<NWM_SOC> {
|
||||
public:
|
||||
NWM_SOC();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
|
|
@ -11,6 +11,9 @@ namespace Service::NWM {
|
|||
class NWM_TST final : public ServiceFramework<NWM_TST> {
|
||||
public:
|
||||
NWM_TST();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::NWM
|
||||
|
|
|
@ -28,6 +28,7 @@ namespace Service::NWM {
|
|||
|
||||
template <class Archive>
|
||||
void NWM_UDS::serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
ar& node_map;
|
||||
ar& connection_event;
|
||||
ar& received_beacons;
|
||||
|
|
|
@ -12,6 +12,9 @@ class PM_APP final : public ServiceFramework<PM_APP> {
|
|||
public:
|
||||
PM_APP();
|
||||
~PM_APP() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::PM
|
||||
|
|
|
@ -12,6 +12,9 @@ class PM_DBG final : public ServiceFramework<PM_DBG> {
|
|||
public:
|
||||
PM_DBG();
|
||||
~PM_DBG() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::PM
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
~PS_PS() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
|
||||
/**
|
||||
* PS_PS::SignRsaSha256 service function
|
||||
* Inputs:
|
||||
|
|
|
@ -13,6 +13,9 @@ class DEV final : public ServiceFramework<DEV> {
|
|||
public:
|
||||
DEV();
|
||||
~DEV();
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::PXI
|
||||
|
|
|
@ -12,6 +12,9 @@ class QTM_C final : public ServiceFramework<QTM_C> {
|
|||
public:
|
||||
QTM_C();
|
||||
~QTM_C() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::QTM
|
||||
|
|
|
@ -12,6 +12,9 @@ class QTM_S final : public ServiceFramework<QTM_S> {
|
|||
public:
|
||||
QTM_S();
|
||||
~QTM_S() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::QTM
|
||||
|
|
|
@ -12,6 +12,9 @@ class QTM_SP final : public ServiceFramework<QTM_SP> {
|
|||
public:
|
||||
QTM_SP();
|
||||
~QTM_SP() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::QTM
|
||||
|
|
|
@ -12,6 +12,9 @@ class QTM_U final : public ServiceFramework<QTM_U> {
|
|||
public:
|
||||
QTM_U();
|
||||
~QTM_U() = default;
|
||||
|
||||
private:
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
} // namespace Service::QTM
|
||||
|
|
|
@ -219,6 +219,13 @@ extern const std::array<ServiceModuleInfo, 40> service_module_map;
|
|||
friend class boost::serialization::access; \
|
||||
friend class ::construct_access;
|
||||
|
||||
#define SERVICE_SERIALIZATION_SIMPLE \
|
||||
template <class Archive> \
|
||||
void serialize(Archive& ar, const unsigned int) { \
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this); \
|
||||
} \
|
||||
friend class boost::serialization::access;
|
||||
|
||||
#define SERVICE_CONSTRUCT(T) \
|
||||
namespace boost::serialization { \
|
||||
template <class Archive> \
|
||||
|
|
|
@ -23,6 +23,8 @@ private:
|
|||
|
||||
// TODO: Implement a proper CSPRNG in the future when actual security is needed
|
||||
std::mt19937 rand_gen;
|
||||
|
||||
SERVICE_SERIALIZATION_SIMPLE
|
||||
};
|
||||
|
||||
void InstallInterfaces(Core::System& system);
|
||||
|
|
|
@ -20,6 +20,7 @@ namespace Service::Y2R {
|
|||
|
||||
template <class Archive>
|
||||
void Y2R_U::serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<Kernel::SessionRequestHandler>(*this);
|
||||
ar& completion_event;
|
||||
ar& conversion;
|
||||
ar& dithering_weight_params;
|
||||
|
|
|
@ -170,7 +170,9 @@ private:
|
|||
MemorySystem::Impl& impl;
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {}
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& boost::serialization::base_object<BackingMem>(*this);
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue