mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 05:19:58 +00:00
olsc: rewrite IOlscServiceForSystemService
This commit is contained in:
parent
a8bca24292
commit
e540757279
3 changed files with 52 additions and 10 deletions
|
@ -870,6 +870,8 @@ add_library(core STATIC
|
||||||
hle/service/olsc/olsc_service_for_system_service.h
|
hle/service/olsc/olsc_service_for_system_service.h
|
||||||
hle/service/olsc/olsc.cpp
|
hle/service/olsc/olsc.cpp
|
||||||
hle/service/olsc/olsc.h
|
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.cpp
|
||||||
hle/service/olsc/transfer_task_list_controller.h
|
hle/service/olsc/transfer_task_list_controller.h
|
||||||
hle/service/omm/omm.cpp
|
hle/service/omm/omm.cpp
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// 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/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"
|
#include "core/hle/service/olsc/transfer_task_list_controller.h"
|
||||||
|
|
||||||
namespace Service::OLSC {
|
namespace Service::OLSC {
|
||||||
|
@ -11,9 +13,9 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_
|
||||||
: ServiceFramework{system_, "olsc:s"} {
|
: ServiceFramework{system_, "olsc:s"} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, &IOlscServiceForSystemService::OpenTransferTaskListController, "OpenTransferTaskListController"},
|
{0, D<&IOlscServiceForSystemService::OpenTransferTaskListController>, "OpenTransferTaskListController"},
|
||||||
{1, nullptr, "OpenRemoteStorageController"},
|
{1, D<&IOlscServiceForSystemService::OpenRemoteStorageController>, "OpenRemoteStorageController"},
|
||||||
{2, nullptr, "OpenDaemonController"},
|
{2, D<&IOlscServiceForSystemService::OpenDaemonController>, "OpenDaemonController"},
|
||||||
{10, nullptr, "Unknown10"},
|
{10, nullptr, "Unknown10"},
|
||||||
{11, nullptr, "Unknown11"},
|
{11, nullptr, "Unknown11"},
|
||||||
{12, nullptr, "Unknown12"},
|
{12, nullptr, "Unknown12"},
|
||||||
|
@ -24,7 +26,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_
|
||||||
{103, nullptr, "GetLastErrorInfo"},
|
{103, nullptr, "GetLastErrorInfo"},
|
||||||
{104, nullptr, "GetLastErrorEventHolder"},
|
{104, nullptr, "GetLastErrorEventHolder"},
|
||||||
{105, nullptr, "GetLastTransferTaskErrorInfo"},
|
{105, nullptr, "GetLastTransferTaskErrorInfo"},
|
||||||
{200, nullptr, "GetDataTransferPolicyInfo"},
|
{200, D<&IOlscServiceForSystemService::GetDataTransferPolicyInfo>, "GetDataTransferPolicyInfo"},
|
||||||
{201, nullptr, "RemoveDataTransferPolicyInfo"},
|
{201, nullptr, "RemoveDataTransferPolicyInfo"},
|
||||||
{202, nullptr, "UpdateDataTransferPolicyOld"},
|
{202, nullptr, "UpdateDataTransferPolicyOld"},
|
||||||
{203, nullptr, "UpdateDataTransferPolicy"},
|
{203, nullptr, "UpdateDataTransferPolicy"},
|
||||||
|
@ -68,6 +70,7 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_
|
||||||
{1122, nullptr, "RepairIssue2"},
|
{1122, nullptr, "RepairIssue2"},
|
||||||
{1123, nullptr, "RepairIssue3"},
|
{1123, nullptr, "RepairIssue3"},
|
||||||
{1124, nullptr, "Unknown1124"},
|
{1124, nullptr, "Unknown1124"},
|
||||||
|
{10000, D<&IOlscServiceForSystemService::CloneService>, "CloneService"},
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@ -76,12 +79,39 @@ IOlscServiceForSystemService::IOlscServiceForSystemService(Core::System& system_
|
||||||
|
|
||||||
IOlscServiceForSystemService::~IOlscServiceForSystemService() = default;
|
IOlscServiceForSystemService::~IOlscServiceForSystemService() = default;
|
||||||
|
|
||||||
void IOlscServiceForSystemService::OpenTransferTaskListController(HLERequestContext& ctx) {
|
Result IOlscServiceForSystemService::OpenTransferTaskListController(
|
||||||
|
Out<SharedPointer<ITransferTaskListController>> out_interface) {
|
||||||
LOG_INFO(Service_OLSC, "called");
|
LOG_INFO(Service_OLSC, "called");
|
||||||
|
*out_interface = std::make_shared<ITransferTaskListController>(system);
|
||||||
|
R_SUCCEED();
|
||||||
|
}
|
||||||
|
|
||||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
Result IOlscServiceForSystemService::OpenRemoteStorageController(
|
||||||
rb.Push(ResultSuccess);
|
Out<SharedPointer<IRemoteStorageController>> out_interface) {
|
||||||
rb.PushIpcInterface<ITransferTaskListController>(system);
|
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
|
} // namespace Service::OLSC
|
||||||
|
|
|
@ -1,17 +1,27 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "core/hle/service/cmif_types.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
namespace Service::OLSC {
|
namespace Service::OLSC {
|
||||||
|
|
||||||
|
class IDaemonController;
|
||||||
|
class IRemoteStorageController;
|
||||||
|
class ITransferTaskListController;
|
||||||
|
|
||||||
class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> {
|
class IOlscServiceForSystemService final : public ServiceFramework<IOlscServiceForSystemService> {
|
||||||
public:
|
public:
|
||||||
explicit IOlscServiceForSystemService(Core::System& system_);
|
explicit IOlscServiceForSystemService(Core::System& system_);
|
||||||
~IOlscServiceForSystemService() override;
|
~IOlscServiceForSystemService() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OpenTransferTaskListController(HLERequestContext& ctx);
|
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
|
} // namespace Service::OLSC
|
||||||
|
|
Loading…
Reference in a new issue