diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 36bc9103e9..d486966544 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -870,6 +870,8 @@ add_library(core STATIC hle/service/olsc/olsc_service_for_system_service.h hle/service/olsc/olsc.cpp hle/service/olsc/olsc.h + hle/service/olsc/remote_storage_controller.cpp + hle/service/olsc/remote_storage_controller.h hle/service/olsc/transfer_task_list_controller.cpp hle/service/olsc/transfer_task_list_controller.h hle/service/omm/omm.cpp 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 index 1873f1245d..f027933c92 100644 --- a/src/core/hle/service/olsc/olsc_service_for_system_service.cpp +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.cpp @@ -1,8 +1,10 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -#include "core/hle/service/ipc_helpers.h" +#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 { @@ -11,9 +13,9 @@ IOlscServiceForSystemService::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"}, + {0, D<&IOlscServiceForSystemService::OpenTransferTaskListController>, "OpenTransferTaskListController"}, + {1, D<&IOlscServiceForSystemService::OpenRemoteStorageController>, "OpenRemoteStorageController"}, + {2, D<&IOlscServiceForSystemService::OpenDaemonController>, "OpenDaemonController"}, {10, nullptr, "Unknown10"}, {11, nullptr, "Unknown11"}, {12, nullptr, "Unknown12"}, @@ -24,7 +26,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ {103, nullptr, "GetLastErrorInfo"}, {104, nullptr, "GetLastErrorEventHolder"}, {105, nullptr, "GetLastTransferTaskErrorInfo"}, - {200, nullptr, "GetDataTransferPolicyInfo"}, + {200, D<&IOlscServiceForSystemService::GetDataTransferPolicyInfo>, "GetDataTransferPolicyInfo"}, {201, nullptr, "RemoveDataTransferPolicyInfo"}, {202, nullptr, "UpdateDataTransferPolicyOld"}, {203, nullptr, "UpdateDataTransferPolicy"}, @@ -68,6 +70,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ {1122, nullptr, "RepairIssue2"}, {1123, nullptr, "RepairIssue3"}, {1124, nullptr, "Unknown1124"}, + {10000, D<&IOlscServiceForSystemService::CloneService>, "CloneService"}, }; // clang-format on @@ -76,12 +79,39 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; -void IOlscServiceForSystemService::OpenTransferTaskListController(HLERequestContext& ctx) { +Result IOlscServiceForSystemService::OpenTransferTaskListController( + Out> out_interface) { LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); +} - IPC::ResponseBuilder rb{ctx, 2, 0, 1}; - rb.Push(ResultSuccess); - rb.PushIpcInterface(system); +Result IOlscServiceForSystemService::OpenRemoteStorageController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::OpenDaemonController( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::make_shared(system); + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::GetDataTransferPolicyInfo(Out out_policy_info, + u64 application_id) { + LOG_WARNING(Service_OLSC, "(STUBBED) called"); + *out_policy_info = 0; + R_SUCCEED(); +} + +Result IOlscServiceForSystemService::CloneService( + Out> out_interface) { + LOG_INFO(Service_OLSC, "called"); + *out_interface = std::static_pointer_cast(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 index a81fba0dca..13026272ac 100644 --- a/src/core/hle/service/olsc/olsc_service_for_system_service.h +++ b/src/core/hle/service/olsc/olsc_service_for_system_service.h @@ -1,17 +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 { public: explicit IOlscServiceForSystemService(Core::System& system_); ~IOlscServiceForSystemService() override; private: - void OpenTransferTaskListController(HLERequestContext& ctx); + Result OpenTransferTaskListController( + Out> out_interface); + Result OpenRemoteStorageController(Out> out_interface); + Result OpenDaemonController(Out> out_interface); + Result GetDataTransferPolicyInfo(Out out_policy_info, u64 application_id); + Result CloneService(Out> out_interface); }; } // namespace Service::OLSC