diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-23 17:34:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 17:34:29 +0100 |
commit | fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5 (patch) | |
tree | 04d960417c9c4aef9108b8640ebf4e82fc3f28a1 /src/core/hle/service/olsc | |
parent | Merge pull request #13100 from liamwhite/audio-ipc (diff) | |
parent | pctl: rewrite IParentalControlService (diff) | |
download | yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.tar yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.tar.gz yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.tar.bz2 yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.tar.lz yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.tar.xz yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.tar.zst yuzu-fa4dec9fe9ff67b0a4f73953b18f0cd7e1698bd5.zip |
Diffstat (limited to 'src/core/hle/service/olsc')
13 files changed, 500 insertions, 211 deletions
diff --git a/src/core/hle/service/olsc/daemon_controller.cpp b/src/core/hle/service/olsc/daemon_controller.cpp new file mode 100644 index 000000000..7823780a8 --- /dev/null +++ b/src/core/hle/service/olsc/daemon_controller.cpp @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/daemon_controller.h" + +namespace Service::OLSC { + +IDaemonController::IDaemonController(Core::System& system_) + : ServiceFramework{system_, "IDaemonController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IDaemonController::GetAutoTransferEnabledForAccountAndApplication>, "GetAutoTransferEnabledForAccountAndApplication"}, + {1, nullptr, "SetAutoTransferEnabledForAccountAndApplication"}, + {2, nullptr, "GetGlobalUploadEnabledForAccount"}, + {3, nullptr, "SetGlobalUploadEnabledForAccount"}, + {4, nullptr, "TouchAccount"}, + {5, nullptr, "GetGlobalDownloadEnabledForAccount"}, + {6, nullptr, "SetGlobalDownloadEnabledForAccount"}, + {10, nullptr, "GetForbiddenSaveDataIndication"}, + {11, nullptr, "GetStopperObject"}, + {12, nullptr, "GetState"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IDaemonController::~IDaemonController() = default; + +Result IDaemonController::GetAutoTransferEnabledForAccountAndApplication(Out<bool> out_is_enabled, + Common::UUID user_id, + u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called, user_id={} application_id={:016X}", + user_id.FormattedString(), application_id); + *out_is_enabled = false; + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/daemon_controller.h b/src/core/hle/service/olsc/daemon_controller.h new file mode 100644 index 000000000..dfad7f52a --- /dev/null +++ b/src/core/hle/service/olsc/daemon_controller.h @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "common/uuid.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::OLSC { + +class IDaemonController final : public ServiceFramework<IDaemonController> { +public: + explicit IDaemonController(Core::System& system_); + ~IDaemonController() override; + +private: + Result GetAutoTransferEnabledForAccountAndApplication(Out<bool> out_is_enabled, + Common::UUID user_id, u64 application_id); +}; + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/native_handle_holder.cpp b/src/core/hle/service/olsc/native_handle_holder.cpp new file mode 100644 index 000000000..3cb5d7b11 --- /dev/null +++ b/src/core/hle/service/olsc/native_handle_holder.cpp @@ -0,0 +1,28 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/native_handle_holder.h" + +namespace Service::OLSC { + +INativeHandleHolder::INativeHandleHolder(Core::System& system_) + : ServiceFramework{system_, "INativeHandleHolder"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&INativeHandleHolder::GetNativeHandle>, "GetNativeHandle"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +INativeHandleHolder::~INativeHandleHolder() = default; + +Result INativeHandleHolder::GetNativeHandle(OutCopyHandle<Kernel::KReadableEvent> out_event) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + *out_event = nullptr; + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/native_handle_holder.h b/src/core/hle/service/olsc/native_handle_holder.h new file mode 100644 index 000000000..a44754c20 --- /dev/null +++ b/src/core/hle/service/olsc/native_handle_holder.h @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Kernel { +class KReadableEvent; +} + +namespace Service::OLSC { + +class INativeHandleHolder final : public ServiceFramework<INativeHandleHolder> { +public: + explicit INativeHandleHolder(Core::System& system_); + ~INativeHandleHolder() override; + +private: + Result GetNativeHandle(OutCopyHandle<Kernel::KReadableEvent> out_event); +}; + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp index 889f27c31..18e5ad43f 100644 --- a/src/core/hle/service/olsc/olsc.cpp +++ b/src/core/hle/service/olsc/olsc.cpp @@ -1,226 +1,27 @@ // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/ipc_helpers.h" #include "core/hle/service/olsc/olsc.h" +#include "core/hle/service/olsc/olsc_service_for_application.h" +#include "core/hle/service/olsc/olsc_service_for_system_service.h" #include "core/hle/service/server_manager.h" #include "core/hle/service/service.h" namespace Service::OLSC { -class IOlscServiceForApplication final : public ServiceFramework<IOlscServiceForApplication> { -public: - explicit IOlscServiceForApplication(Core::System& system_) - : ServiceFramework{system_, "olsc:u"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IOlscServiceForApplication::Initialize, "Initialize"}, - {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, - {13, &IOlscServiceForApplication::GetSaveDataBackupSetting, "GetSaveDataBackupSetting"}, - {14, &IOlscServiceForApplication::SetSaveDataBackupSettingEnabled, "SetSaveDataBackupSettingEnabled"}, - {15, nullptr, "SetCustomData"}, - {16, nullptr, "DeleteSaveDataBackupSetting"}, - {18, nullptr, "GetSaveDataBackupInfoCache"}, - {19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"}, - {22, nullptr, "DeleteSaveDataBackupAsync"}, - {25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"}, - {26, nullptr, "DownloadSaveDataBackupAsync"}, - {27, nullptr, "UploadSaveDataBackupAsync"}, - {9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"}, - {9013, nullptr, "GetSaveDataBackupSettingForDebug"}, - {9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"}, - {9015, nullptr, "SetCustomDataForDebug"}, - {9016, nullptr, "DeleteSaveDataBackupSettingForDebug"}, - {9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"}, - {9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"}, - {9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"}, - {9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"}, - {9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"}, - }; - // clang-format on - - RegisterHandlers(functions); - } - -private: - void Initialize(HLERequestContext& ctx) { - LOG_WARNING(Service_OLSC, "(STUBBED) called"); - - initialized = true; - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - void GetSaveDataBackupSetting(HLERequestContext& ctx) { - LOG_WARNING(Service_OLSC, "(STUBBED) called"); - - // backup_setting is set to 0 since real value is unknown - constexpr u64 backup_setting = 0; - - IPC::ResponseBuilder rb{ctx, 4}; - rb.Push(ResultSuccess); - rb.Push(backup_setting); - } - - void SetSaveDataBackupSettingEnabled(HLERequestContext& ctx) { - LOG_WARNING(Service_OLSC, "(STUBBED) called"); - - IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(ResultSuccess); - } - - bool initialized{}; -}; - -class INativeHandleHolder final : public ServiceFramework<INativeHandleHolder> { -public: - explicit INativeHandleHolder(Core::System& system_) - : ServiceFramework{system_, "INativeHandleHolder"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "GetNativeHandle"}, - }; - // clang-format on - - RegisterHandlers(functions); - } -}; - -class ITransferTaskListController final : public ServiceFramework<ITransferTaskListController> { -public: - explicit ITransferTaskListController(Core::System& system_) - : ServiceFramework{system_, "ITransferTaskListController"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, nullptr, "Unknown0"}, - {1, nullptr, "Unknown1"}, - {2, nullptr, "Unknown2"}, - {3, nullptr, "Unknown3"}, - {4, nullptr, "Unknown4"}, - {5, &ITransferTaskListController::GetNativeHandleHolder , "GetNativeHandleHolder"}, - {6, nullptr, "Unknown6"}, - {7, nullptr, "Unknown7"}, - {8, nullptr, "GetRemoteStorageController"}, - {9, &ITransferTaskListController::GetNativeHandleHolder, "GetNativeHandleHolder2"}, - {10, nullptr, "Unknown10"}, - {11, nullptr, "Unknown11"}, - {12, nullptr, "Unknown12"}, - {13, nullptr, "Unknown13"}, - {14, nullptr, "Unknown14"}, - {15, nullptr, "Unknown15"}, - {16, nullptr, "Unknown16"}, - {17, nullptr, "Unknown17"}, - {18, nullptr, "Unknown18"}, - {19, nullptr, "Unknown19"}, - {20, nullptr, "Unknown20"}, - {21, nullptr, "Unknown21"}, - {22, nullptr, "Unknown22"}, - {23, nullptr, "Unknown23"}, - {24, nullptr, "Unknown24"}, - {25, nullptr, "Unknown25"}, - }; - // clang-format on - - RegisterHandlers(functions); - } - -private: - void GetNativeHandleHolder(HLERequestContext& ctx) { - LOG_INFO(Service_OLSC, "called"); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface<INativeHandleHolder>(system); - } -}; - -class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> { -public: - explicit IOlscServiceForSystemService(Core::System& system_) - : ServiceFramework{system_, "olsc:s"} { - // clang-format off - static const FunctionInfo functions[] = { - {0, &IOlscServiceForSystemService::OpenTransferTaskListController, "OpenTransferTaskListController"}, - {1, nullptr, "OpenRemoteStorageController"}, - {2, nullptr, "OpenDaemonController"}, - {10, nullptr, "Unknown10"}, - {11, nullptr, "Unknown11"}, - {12, nullptr, "Unknown12"}, - {13, nullptr, "Unknown13"}, - {100, nullptr, "ListLastTransferTaskErrorInfo"}, - {101, nullptr, "GetLastErrorInfoCount"}, - {102, nullptr, "RemoveLastErrorInfoOld"}, - {103, nullptr, "GetLastErrorInfo"}, - {104, nullptr, "GetLastErrorEventHolder"}, - {105, nullptr, "GetLastTransferTaskErrorInfo"}, - {200, nullptr, "GetDataTransferPolicyInfo"}, - {201, nullptr, "RemoveDataTransferPolicyInfo"}, - {202, nullptr, "UpdateDataTransferPolicyOld"}, - {203, nullptr, "UpdateDataTransferPolicy"}, - {204, nullptr, "CleanupDataTransferPolicyInfo"}, - {205, nullptr, "RequestDataTransferPolicy"}, - {300, nullptr, "GetAutoTransferSeriesInfo"}, - {301, nullptr, "UpdateAutoTransferSeriesInfo"}, - {400, nullptr, "CleanupSaveDataArchiveInfoType1"}, - {900, nullptr, "CleanupTransferTask"}, - {902, nullptr, "CleanupSeriesInfoType0"}, - {903, nullptr, "CleanupSaveDataArchiveInfoType0"}, - {904, nullptr, "CleanupApplicationAutoTransferSetting"}, - {905, nullptr, "CleanupErrorHistory"}, - {906, nullptr, "SetLastError"}, - {907, nullptr, "AddSaveDataArchiveInfoType0"}, - {908, nullptr, "RemoveSeriesInfoType0"}, - {909, nullptr, "GetSeriesInfoType0"}, - {910, nullptr, "RemoveLastErrorInfo"}, - {911, nullptr, "CleanupSeriesInfoType1"}, - {912, nullptr, "RemoveSeriesInfoType1"}, - {913, nullptr, "GetSeriesInfoType1"}, - {1000, nullptr, "UpdateIssueOld"}, - {1010, nullptr, "Unknown1010"}, - {1011, nullptr, "ListIssueInfoOld"}, - {1012, nullptr, "GetIssueOld"}, - {1013, nullptr, "GetIssue2Old"}, - {1014, nullptr, "GetIssue3Old"}, - {1020, nullptr, "RepairIssueOld"}, - {1021, nullptr, "RepairIssueWithUserIdOld"}, - {1022, nullptr, "RepairIssue2Old"}, - {1023, nullptr, "RepairIssue3Old"}, - {1024, nullptr, "Unknown1024"}, - {1100, nullptr, "UpdateIssue"}, - {1110, nullptr, "Unknown1110"}, - {1111, nullptr, "ListIssueInfo"}, - {1112, nullptr, "GetIssue"}, - {1113, nullptr, "GetIssue2"}, - {1114, nullptr, "GetIssue3"}, - {1120, nullptr, "RepairIssue"}, - {1121, nullptr, "RepairIssueWithUserId"}, - {1122, nullptr, "RepairIssue2"}, - {1123, nullptr, "RepairIssue3"}, - {1124, nullptr, "Unknown1124"}, - }; - // clang-format on - - RegisterHandlers(functions); - } - -private: - void OpenTransferTaskListController(HLERequestContext& ctx) { - LOG_INFO(Service_OLSC, "called"); - - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface<ITransferTaskListController>(system); - } -}; - void LoopProcess(Core::System& system) { auto server_manager = std::make_unique<ServerManager>(system); - server_manager->RegisterNamedService("olsc:u", - std::make_shared<IOlscServiceForApplication>(system)); - server_manager->RegisterNamedService("olsc:s", - std::make_shared<IOlscServiceForSystemService>(system)); + const auto OlscFactoryForApplication = [&] { + return std::make_shared<IOlscServiceForApplication>(system); + }; + + const auto OlscFactoryForSystemService = [&] { + return std::make_shared<IOlscServiceForSystemService>(system); + }; + + server_manager->RegisterNamedService("olsc:u", OlscFactoryForApplication); + server_manager->RegisterNamedService("olsc:s", OlscFactoryForSystemService); ServerManager::RunServer(std::move(server_manager)); } diff --git a/src/core/hle/service/olsc/olsc_service_for_application.cpp b/src/core/hle/service/olsc/olsc_service_for_application.cpp new file mode 100644 index 000000000..01360f5ef --- /dev/null +++ b/src/core/hle/service/olsc/olsc_service_for_application.cpp @@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/olsc_service_for_application.h" + +namespace Service::OLSC { + +IOlscServiceForApplication::IOlscServiceForApplication(Core::System& system_) + : ServiceFramework{system_, "olsc:u"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOlscServiceForApplication::Initialize>, "Initialize"}, + {10, nullptr, "VerifySaveDataBackupLicenseAsync"}, + {13, D<&IOlscServiceForApplication::GetSaveDataBackupSetting>, "GetSaveDataBackupSetting"}, + {14, D<&IOlscServiceForApplication::SetSaveDataBackupSettingEnabled>, "SetSaveDataBackupSettingEnabled"}, + {15, nullptr, "SetCustomData"}, + {16, nullptr, "DeleteSaveDataBackupSetting"}, + {18, nullptr, "GetSaveDataBackupInfoCache"}, + {19, nullptr, "UpdateSaveDataBackupInfoCacheAsync"}, + {22, nullptr, "DeleteSaveDataBackupAsync"}, + {25, nullptr, "ListDownloadableSaveDataBackupInfoAsync"}, + {26, nullptr, "DownloadSaveDataBackupAsync"}, + {27, nullptr, "UploadSaveDataBackupAsync"}, + {9010, nullptr, "VerifySaveDataBackupLicenseAsyncForDebug"}, + {9013, nullptr, "GetSaveDataBackupSettingForDebug"}, + {9014, nullptr, "SetSaveDataBackupSettingEnabledForDebug"}, + {9015, nullptr, "SetCustomDataForDebug"}, + {9016, nullptr, "DeleteSaveDataBackupSettingForDebug"}, + {9018, nullptr, "GetSaveDataBackupInfoCacheForDebug"}, + {9019, nullptr, "UpdateSaveDataBackupInfoCacheAsyncForDebug"}, + {9022, nullptr, "DeleteSaveDataBackupAsyncForDebug"}, + {9025, nullptr, "ListDownloadableSaveDataBackupInfoAsyncForDebug"}, + {9026, nullptr, "DownloadSaveDataBackupAsyncForDebug"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IOlscServiceForApplication::~IOlscServiceForApplication() = default; + +Result IOlscServiceForApplication::Initialize(ClientProcessId process_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + initialized = true; + R_SUCCEED(); +} + +Result IOlscServiceForApplication::GetSaveDataBackupSetting(Out<u8> out_save_data_backup_setting) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + // backup_setting is set to 0 since real value is unknown + *out_save_data_backup_setting = 0; + R_SUCCEED(); +} + +Result IOlscServiceForApplication::SetSaveDataBackupSettingEnabled(bool enabled, + NS::Uid account_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called, enabled={}, account_id={}", enabled, + account_id.uuid.FormattedString()); + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/olsc_service_for_application.h b/src/core/hle/service/olsc/olsc_service_for_application.h new file mode 100644 index 000000000..3f9ac7536 --- /dev/null +++ b/src/core/hle/service/olsc/olsc_service_for_application.h @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/ns/ns_types.h" +#include "core/hle/service/service.h" + +namespace Service::OLSC { + +class IOlscServiceForApplication final : public ServiceFramework<IOlscServiceForApplication> { +public: + explicit IOlscServiceForApplication(Core::System& system_); + ~IOlscServiceForApplication() override; + +private: + Result Initialize(ClientProcessId process_id); + Result GetSaveDataBackupSetting(Out<u8> out_save_data_backup_setting); + Result SetSaveDataBackupSettingEnabled(bool enabled, NS::Uid account_id); + + bool initialized{}; +}; + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp new file mode 100644 index 000000000..f027933c9 --- /dev/null +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp @@ -0,0 +1,117 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/daemon_controller.h" +#include "core/hle/service/olsc/olsc_service_for_system_service.h" +#include "core/hle/service/olsc/remote_storage_controller.h" +#include "core/hle/service/olsc/transfer_task_list_controller.h" + +namespace Service::OLSC { + +IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_) + : ServiceFramework{system_, "olsc:s"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, D<&IOlscServiceForSystemService::OpenTransferTaskListController>, "OpenTransferTaskListController"}, + {1, D<&IOlscServiceForSystemService::OpenRemoteStorageController>, "OpenRemoteStorageController"}, + {2, D<&IOlscServiceForSystemService::OpenDaemonController>, "OpenDaemonController"}, + {10, nullptr, "Unknown10"}, + {11, nullptr, "Unknown11"}, + {12, nullptr, "Unknown12"}, + {13, nullptr, "Unknown13"}, + {100, nullptr, "ListLastTransferTaskErrorInfo"}, + {101, nullptr, "GetLastErrorInfoCount"}, + {102, nullptr, "RemoveLastErrorInfoOld"}, + {103, nullptr, "GetLastErrorInfo"}, + {104, nullptr, "GetLastErrorEventHolder"}, + {105, nullptr, "GetLastTransferTaskErrorInfo"}, + {200, D<&IOlscServiceForSystemService::GetDataTransferPolicyInfo>, "GetDataTransferPolicyInfo"}, + {201, nullptr, "RemoveDataTransferPolicyInfo"}, + {202, nullptr, "UpdateDataTransferPolicyOld"}, + {203, nullptr, "UpdateDataTransferPolicy"}, + {204, nullptr, "CleanupDataTransferPolicyInfo"}, + {205, nullptr, "RequestDataTransferPolicy"}, + {300, nullptr, "GetAutoTransferSeriesInfo"}, + {301, nullptr, "UpdateAutoTransferSeriesInfo"}, + {400, nullptr, "CleanupSaveDataArchiveInfoType1"}, + {900, nullptr, "CleanupTransferTask"}, + {902, nullptr, "CleanupSeriesInfoType0"}, + {903, nullptr, "CleanupSaveDataArchiveInfoType0"}, + {904, nullptr, "CleanupApplicationAutoTransferSetting"}, + {905, nullptr, "CleanupErrorHistory"}, + {906, nullptr, "SetLastError"}, + {907, nullptr, "AddSaveDataArchiveInfoType0"}, + {908, nullptr, "RemoveSeriesInfoType0"}, + {909, nullptr, "GetSeriesInfoType0"}, + {910, nullptr, "RemoveLastErrorInfo"}, + {911, nullptr, "CleanupSeriesInfoType1"}, + {912, nullptr, "RemoveSeriesInfoType1"}, + {913, nullptr, "GetSeriesInfoType1"}, + {1000, nullptr, "UpdateIssueOld"}, + {1010, nullptr, "Unknown1010"}, + {1011, nullptr, "ListIssueInfoOld"}, + {1012, nullptr, "GetIssueOld"}, + {1013, nullptr, "GetIssue2Old"}, + {1014, nullptr, "GetIssue3Old"}, + {1020, nullptr, "RepairIssueOld"}, + {1021, nullptr, "RepairIssueWithUserIdOld"}, + {1022, nullptr, "RepairIssue2Old"}, + {1023, nullptr, "RepairIssue3Old"}, + {1024, nullptr, "Unknown1024"}, + {1100, nullptr, "UpdateIssue"}, + {1110, nullptr, "Unknown1110"}, + {1111, nullptr, "ListIssueInfo"}, + {1112, nullptr, "GetIssue"}, + {1113, nullptr, "GetIssue2"}, + {1114, nullptr, "GetIssue3"}, + {1120, nullptr, "RepairIssue"}, + {1121, nullptr, "RepairIssueWithUserId"}, + {1122, nullptr, "RepairIssue2"}, + {1123, nullptr, "RepairIssue3"}, + {1124, nullptr, "Unknown1124"}, + {10000, D<&IOlscServiceForSystemService::CloneService>, "CloneService"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; + +Result IOlscServiceForSystemService::OpenTransferTaskListController( + Out<SharedPointer<ITransferTaskListController>> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared<ITransferTaskListController>(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::OpenRemoteStorageController( + Out<SharedPointer<IRemoteStorageController>> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared<IRemoteStorageController>(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::OpenDaemonController( + Out<SharedPointer<IDaemonController>> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared<IDaemonController>(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetDataTransferPolicyInfo(Out<u16> out_policy_info, + u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + *out_policy_info = 0; + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::CloneService( + Out<SharedPointer<IOlscServiceForSystemService>> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::static_pointer_cast<IOlscServiceForSystemService>(shared_from_this()); + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/olsc_service_for_system_service.h b/src/core/hle/service/olsc/olsc_service_for_system_service.h new file mode 100644 index 000000000..13026272a --- /dev/null +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.h @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::OLSC { + +class IDaemonController; +class IRemoteStorageController; +class ITransferTaskListController; + +class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> { +public: + explicit IOlscServiceForSystemService(Core::System& system_); + ~IOlscServiceForSystemService() override; + +private: + Result OpenTransferTaskListController( + Out<SharedPointer<ITransferTaskListController>> out_interface); + Result OpenRemoteStorageController(Out<SharedPointer<IRemoteStorageController>> out_interface); + Result OpenDaemonController(Out<SharedPointer<IDaemonController>> out_interface); + Result GetDataTransferPolicyInfo(Out<u16> out_policy_info, u64 application_id); + Result CloneService(Out<SharedPointer<IOlscServiceForSystemService>> out_interface); +}; + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/remote_storage_controller.cpp b/src/core/hle/service/olsc/remote_storage_controller.cpp new file mode 100644 index 000000000..81d9c96ab --- /dev/null +++ b/src/core/hle/service/olsc/remote_storage_controller.cpp @@ -0,0 +1,54 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/remote_storage_controller.h" + +namespace Service::OLSC { + +IRemoteStorageController::IRemoteStorageController(Core::System& system_) + : ServiceFramework{system_, "IRemoteStorageController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "GetSaveDataArchiveInfoBySaveDataId"}, + {1, nullptr, "GetSaveDataArchiveInfoByApplicationId"}, + {3, nullptr, "GetSaveDataArchiveCount"}, + {6, nullptr, "CleanupSaveDataArchives"}, + {7, nullptr, "CreateSaveDataArchiveCacheUpdationTask"}, + {8, nullptr, "CreateSaveDataArchiveCacheUpdationForSpecifiedApplicationTask"}, + {9, nullptr, "Delete"}, + {10, nullptr, "GetSeriesInfo"}, + {11, nullptr, "CreateDeleteDataTask"}, + {12, nullptr, "DeleteSeriesInfo"}, + {13, nullptr, "CreateRegisterNotificationTokenTask"}, + {14, nullptr, "UpdateSeriesInfo"}, + {15, nullptr, "RegisterUploadSaveDataTransferTaskForAutonomyRegistration"}, + {16, nullptr, "CreateCleanupToDeleteSaveDataArchiveInfoTask"}, + {17, nullptr, "ListDataInfo"}, + {18, nullptr, "GetDataInfo"}, + {19, nullptr, "Unknown19"}, + {20, nullptr, "CreateSaveDataArchiveInfoCacheForSaveDataBackupUpdationTask"}, + {21, nullptr, "ListSecondarySaves"}, + {22, D<&IRemoteStorageController::GetSecondarySave>, "GetSecondarySave"}, + {23, nullptr, "TouchSecondarySave"}, + {24, nullptr, "GetSecondarySaveDataInfo"}, + {25, nullptr, "RegisterDownloadSaveDataTransferTaskForAutonomyRegistration"}, + {900, nullptr, "Unknown900"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +IRemoteStorageController::~IRemoteStorageController() = default; + +Result IRemoteStorageController::GetSecondarySave(Out<bool> out_has_secondary_save, + Out<std::array<u64, 3>> out_unknown, + u64 application_id) { + LOG_ERROR(Service_OLSC, "(STUBBED) called, application_id={:016X}", application_id); + *out_has_secondary_save = false; + *out_unknown = {}; + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/remote_storage_controller.h b/src/core/hle/service/olsc/remote_storage_controller.h new file mode 100644 index 000000000..e7a0b5244 --- /dev/null +++ b/src/core/hle/service/olsc/remote_storage_controller.h @@ -0,0 +1,19 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::OLSC { + +class IRemoteStorageController final : public ServiceFramework<IRemoteStorageController> { +public: + explicit IRemoteStorageController(Core::System& system_); + ~IRemoteStorageController() override; + +private: + Result GetSecondarySave(Out<bool> out_has_secondary_save, Out<std::array<u64, 3>> out_unknown, + u64 application_id); +}; + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.cpp b/src/core/hle/service/olsc/transfer_task_list_controller.cpp new file mode 100644 index 000000000..8ea9a0f1e --- /dev/null +++ b/src/core/hle/service/olsc/transfer_task_list_controller.cpp @@ -0,0 +1,55 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_serialization.h" +#include "core/hle/service/olsc/native_handle_holder.h" +#include "core/hle/service/olsc/transfer_task_list_controller.h" + +namespace Service::OLSC { + +ITransferTaskListController::ITransferTaskListController(Core::System& system_) + : ServiceFramework{system_, "ITransferTaskListController"} { + // clang-format off + static const FunctionInfo functions[] = { + {0, nullptr, "Unknown0"}, + {1, nullptr, "Unknown1"}, + {2, nullptr, "Unknown2"}, + {3, nullptr, "Unknown3"}, + {4, nullptr, "Unknown4"}, + {5, D<&ITransferTaskListController::GetNativeHandleHolder>, "GetNativeHandleHolder"}, + {6, nullptr, "Unknown6"}, + {7, nullptr, "Unknown7"}, + {8, nullptr, "GetRemoteStorageController"}, + {9, D<&ITransferTaskListController::GetNativeHandleHolder>, "GetNativeHandleHolder2"}, + {10, nullptr, "Unknown10"}, + {11, nullptr, "Unknown11"}, + {12, nullptr, "Unknown12"}, + {13, nullptr, "Unknown13"}, + {14, nullptr, "Unknown14"}, + {15, nullptr, "Unknown15"}, + {16, nullptr, "Unknown16"}, + {17, nullptr, "Unknown17"}, + {18, nullptr, "Unknown18"}, + {19, nullptr, "Unknown19"}, + {20, nullptr, "Unknown20"}, + {21, nullptr, "Unknown21"}, + {22, nullptr, "Unknown22"}, + {23, nullptr, "Unknown23"}, + {24, nullptr, "Unknown24"}, + {25, nullptr, "Unknown25"}, + }; + // clang-format on + + RegisterHandlers(functions); +} + +ITransferTaskListController::~ITransferTaskListController() = default; + +Result ITransferTaskListController::GetNativeHandleHolder( + Out<SharedPointer<INativeHandleHolder>> out_holder) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + *out_holder = std::make_shared<INativeHandleHolder>(system); + R_SUCCEED(); +} + +} // namespace Service::OLSC diff --git a/src/core/hle/service/olsc/transfer_task_list_controller.h b/src/core/hle/service/olsc/transfer_task_list_controller.h new file mode 100644 index 000000000..f10a71375 --- /dev/null +++ b/src/core/hle/service/olsc/transfer_task_list_controller.h @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::OLSC { + +class INativeHandleHolder; + +class ITransferTaskListController final : public ServiceFramework<ITransferTaskListController> { +public: + explicit ITransferTaskListController(Core::System& system_); + ~ITransferTaskListController() override; + +private: + Result GetNativeHandleHolder(Out<SharedPointer<INativeHandleHolder>> out_holder); +}; + +} // namespace Service::OLSC |