diff options
| author | 2024-02-21 19:59:41 -0500 | |
|---|---|---|
| committer | 2024-02-21 20:02:00 -0500 | |
| commit | e540757279ee2e9cc1ed395f0480d6136d57e1b9 (patch) | |
| tree | 8c5a552263401bb89ce71f912b6b77a608ca7ff2 /src/core/hle | |
| parent | olsc: add IRemoteStorageController (diff) | |
| download | yuzu-e540757279ee2e9cc1ed395f0480d6136d57e1b9.tar.gz yuzu-e540757279ee2e9cc1ed395f0480d6136d57e1b9.tar.xz yuzu-e540757279ee2e9cc1ed395f0480d6136d57e1b9.zip | |
olsc: rewrite IOlscServiceForSystemService
Diffstat (limited to 'src/core/hle')
| -rw-r--r-- | src/core/hle/service/olsc/olsc_service_for_system_service.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/service/olsc/olsc_service_for_system_service.h | 12 |
2 files changed, 50 insertions, 10 deletions
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 1873f1245..f027933c9 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 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/ipc_helpers.h" | 4 | #include "core/hle/service/cmif_serialization.h" |
| 5 | #include "core/hle/service/olsc/daemon_controller.h" | ||
| 5 | #include "core/hle/service/olsc/olsc_service_for_system_service.h" | 6 | #include "core/hle/service/olsc/olsc_service_for_system_service.h" |
| 7 | #include "core/hle/service/olsc/remote_storage_controller.h" | ||
| 6 | #include "core/hle/service/olsc/transfer_task_list_controller.h" | 8 | #include "core/hle/service/olsc/transfer_task_list_controller.h" |
| 7 | 9 | ||
| 8 | namespace Service::OLSC { | 10 | namespace Service::OLSC { |
| @@ -11,9 +13,9 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ | |||
| 11 | : ServiceFramework{system_, "olsc:s"} { | 13 | : ServiceFramework{system_, "olsc:s"} { |
| 12 | // clang-format off | 14 | // clang-format off |
| 13 | static const FunctionInfo functions[] = { | 15 | static const FunctionInfo functions[] = { |
| 14 | {0, &IOlscServiceForSystemService::OpenTransferTaskListController, "OpenTransferTaskListController"}, | 16 | {0, D<&IOlscServiceForSystemService::OpenTransferTaskListController>, "OpenTransferTaskListController"}, |
| 15 | {1, nullptr, "OpenRemoteStorageController"}, | 17 | {1, D<&IOlscServiceForSystemService::OpenRemoteStorageController>, "OpenRemoteStorageController"}, |
| 16 | {2, nullptr, "OpenDaemonController"}, | 18 | {2, D<&IOlscServiceForSystemService::OpenDaemonController>, "OpenDaemonController"}, |
| 17 | {10, nullptr, "Unknown10"}, | 19 | {10, nullptr, "Unknown10"}, |
| 18 | {11, nullptr, "Unknown11"}, | 20 | {11, nullptr, "Unknown11"}, |
| 19 | {12, nullptr, "Unknown12"}, | 21 | {12, nullptr, "Unknown12"}, |
| @@ -24,7 +26,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ | |||
| 24 | {103, nullptr, "GetLastErrorInfo"}, | 26 | {103, nullptr, "GetLastErrorInfo"}, |
| 25 | {104, nullptr, "GetLastErrorEventHolder"}, | 27 | {104, nullptr, "GetLastErrorEventHolder"}, |
| 26 | {105, nullptr, "GetLastTransferTaskErrorInfo"}, | 28 | {105, nullptr, "GetLastTransferTaskErrorInfo"}, |
| 27 | {200, nullptr, "GetDataTransferPolicyInfo"}, | 29 | {200, D<&IOlscServiceForSystemService::GetDataTransferPolicyInfo>, "GetDataTransferPolicyInfo"}, |
| 28 | {201, nullptr, "RemoveDataTransferPolicyInfo"}, | 30 | {201, nullptr, "RemoveDataTransferPolicyInfo"}, |
| 29 | {202, nullptr, "UpdateDataTransferPolicyOld"}, | 31 | {202, nullptr, "UpdateDataTransferPolicyOld"}, |
| 30 | {203, nullptr, "UpdateDataTransferPolicy"}, | 32 | {203, nullptr, "UpdateDataTransferPolicy"}, |
| @@ -68,6 +70,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ | |||
| 68 | {1122, nullptr, "RepairIssue2"}, | 70 | {1122, nullptr, "RepairIssue2"}, |
| 69 | {1123, nullptr, "RepairIssue3"}, | 71 | {1123, nullptr, "RepairIssue3"}, |
| 70 | {1124, nullptr, "Unknown1124"}, | 72 | {1124, nullptr, "Unknown1124"}, |
| 73 | {10000, D<&IOlscServiceForSystemService::CloneService>, "CloneService"}, | ||
| 71 | }; | 74 | }; |
| 72 | // clang-format on | 75 | // clang-format on |
| 73 | 76 | ||
| @@ -76,12 +79,39 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_ | |||
| 76 | 79 | ||
| 77 | IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; | 80 | IOlscServiceForSystemService::~IOlscServiceForSystemService() = default; |
| 78 | 81 | ||
| 79 | void IOlscServiceForSystemService::OpenTransferTaskListController(HLERequestContext& ctx) { | 82 | Result IOlscServiceForSystemService::OpenTransferTaskListController( |
| 83 | Out<SharedPointer<ITransferTaskListController>> out_interface) { | ||
| 80 | LOG_INFO(Service_OLSC, "called"); | 84 | LOG_INFO(Service_OLSC, "called"); |
| 85 | *out_interface = std::make_shared<ITransferTaskListController>(system); | ||
| 86 | R_SUCCEED(); | ||
| 87 | } | ||
| 88 | |||
| 89 | Result IOlscServiceForSystemService::OpenRemoteStorageController( | ||
| 90 | Out<SharedPointer<IRemoteStorageController>> out_interface) { | ||
| 91 | LOG_INFO(Service_OLSC, "called"); | ||
| 92 | *out_interface = std::make_shared<IRemoteStorageController>(system); | ||
| 93 | R_SUCCEED(); | ||
| 94 | } | ||
| 95 | |||
| 96 | Result IOlscServiceForSystemService::OpenDaemonController( | ||
| 97 | Out<SharedPointer<IDaemonController>> out_interface) { | ||
| 98 | LOG_INFO(Service_OLSC, "called"); | ||
| 99 | *out_interface = std::make_shared<IDaemonController>(system); | ||
| 100 | R_SUCCEED(); | ||
| 101 | } | ||
| 81 | 102 | ||
| 82 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 103 | Result IOlscServiceForSystemService::GetDataTransferPolicyInfo(Out<u16> out_policy_info, |
| 83 | rb.Push(ResultSuccess); | 104 | u64 application_id) { |
| 84 | rb.PushIpcInterface<ITransferTaskListController>(system); | 105 | LOG_WARNING(Service_OLSC, "(STUBBED) called"); |
| 106 | *out_policy_info = 0; | ||
| 107 | R_SUCCEED(); | ||
| 108 | } | ||
| 109 | |||
| 110 | Result IOlscServiceForSystemService::CloneService( | ||
| 111 | Out<SharedPointer<IOlscServiceForSystemService>> out_interface) { | ||
| 112 | LOG_INFO(Service_OLSC, "called"); | ||
| 113 | *out_interface = std::static_pointer_cast<IOlscServiceForSystemService>(shared_from_this()); | ||
| 114 | R_SUCCEED(); | ||
| 85 | } | 115 | } |
| 86 | 116 | ||
| 87 | } // namespace Service::OLSC | 117 | } // 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 a81fba0dc..13026272a 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 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "core/hle/service/cmif_types.h" | ||
| 4 | #include "core/hle/service/service.h" | 5 | #include "core/hle/service/service.h" |
| 5 | 6 | ||
| 6 | namespace Service::OLSC { | 7 | namespace Service::OLSC { |
| 7 | 8 | ||
| 9 | class IDaemonController; | ||
| 10 | class IRemoteStorageController; | ||
| 11 | class ITransferTaskListController; | ||
| 12 | |||
| 8 | class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> { | 13 | class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> { |
| 9 | public: | 14 | public: |
| 10 | explicit IOlscServiceForSystemService(Core::System& system_); | 15 | explicit IOlscServiceForSystemService(Core::System& system_); |
| 11 | ~IOlscServiceForSystemService() override; | 16 | ~IOlscServiceForSystemService() override; |
| 12 | 17 | ||
| 13 | private: | 18 | private: |
| 14 | void OpenTransferTaskListController(HLERequestContext& ctx); | 19 | Result OpenTransferTaskListController( |
| 20 | Out<SharedPointer<ITransferTaskListController>> out_interface); | ||
| 21 | Result OpenRemoteStorageController(Out<SharedPointer<IRemoteStorageController>> out_interface); | ||
| 22 | Result OpenDaemonController(Out<SharedPointer<IDaemonController>> out_interface); | ||
| 23 | Result GetDataTransferPolicyInfo(Out<u16> out_policy_info, u64 application_id); | ||
| 24 | Result CloneService(Out<SharedPointer<IOlscServiceForSystemService>> out_interface); | ||
| 15 | }; | 25 | }; |
| 16 | 26 | ||
| 17 | } // namespace Service::OLSC | 27 | } // namespace Service::OLSC |