diff options
| author | 2024-02-17 13:54:36 -0500 | |
|---|---|---|
| committer | 2024-02-18 10:32:21 -0500 | |
| commit | 626f2e65b1a799d3e5c517d480a4691176fbe8d6 (patch) | |
| tree | b23c45a1330acab0ed8282697328422e5437385b | |
| parent | ns: rewrite IReadOnlyApplicationControlDataInterface (diff) | |
| download | yuzu-626f2e65b1a799d3e5c517d480a4691176fbe8d6.tar.gz yuzu-626f2e65b1a799d3e5c517d480a4691176fbe8d6.tar.xz yuzu-626f2e65b1a799d3e5c517d480a4691176fbe8d6.zip | |
ns: rewrite IVulnerabilityManagerInterface
| -rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/core/hle/service/ns/ns.cpp | 28 | ||||
| -rw-r--r-- | src/core/hle/service/ns/vulnerability_manager_interface.cpp | 31 | ||||
| -rw-r--r-- | src/core/hle/service/ns/vulnerability_manager_interface.h | 21 |
4 files changed, 57 insertions, 25 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index bc515949c..12a6fe273 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -769,6 +769,8 @@ add_library(core STATIC | |||
| 769 | hle/service/ns/read_only_application_control_data_interface.h | 769 | hle/service/ns/read_only_application_control_data_interface.h |
| 770 | hle/service/ns/read_only_application_record_interface.cpp | 770 | hle/service/ns/read_only_application_record_interface.cpp |
| 771 | hle/service/ns/read_only_application_record_interface.h | 771 | hle/service/ns/read_only_application_record_interface.h |
| 772 | hle/service/ns/vulnerability_manager_interface.cpp | ||
| 773 | hle/service/ns/vulnerability_manager_interface.h | ||
| 772 | hle/service/nvdrv/core/container.cpp | 774 | hle/service/nvdrv/core/container.cpp |
| 773 | hle/service/nvdrv/core/container.h | 775 | hle/service/nvdrv/core/container.h |
| 774 | hle/service/nvdrv/core/heap_mapper.cpp | 776 | hle/service/nvdrv/core/heap_mapper.cpp |
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index b5ad27dd8..39d3c67c0 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include "core/hle/service/ns/platform_service_manager.h" | 26 | #include "core/hle/service/ns/platform_service_manager.h" |
| 27 | #include "core/hle/service/ns/read_only_application_control_data_interface.h" | 27 | #include "core/hle/service/ns/read_only_application_control_data_interface.h" |
| 28 | #include "core/hle/service/ns/read_only_application_record_interface.h" | 28 | #include "core/hle/service/ns/read_only_application_record_interface.h" |
| 29 | #include "core/hle/service/ns/vulnerability_manager_interface.h" | ||
| 29 | #include "core/hle/service/server_manager.h" | 30 | #include "core/hle/service/server_manager.h" |
| 30 | #include "core/hle/service/set/settings_server.h" | 31 | #include "core/hle/service/set/settings_server.h" |
| 31 | 32 | ||
| @@ -601,30 +602,6 @@ private: | |||
| 601 | } | 602 | } |
| 602 | }; | 603 | }; |
| 603 | 604 | ||
| 604 | class NS_VM final : public ServiceFramework<NS_VM> { | ||
| 605 | public: | ||
| 606 | explicit NS_VM(Core::System& system_) : ServiceFramework{system_, "ns:vm"} { | ||
| 607 | // clang-format off | ||
| 608 | static const FunctionInfo functions[] = { | ||
| 609 | {1200, &NS_VM::NeedsUpdateVulnerability, "NeedsUpdateVulnerability"}, | ||
| 610 | {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, | ||
| 611 | {1202, nullptr, "GetSafeSystemVersion"}, | ||
| 612 | }; | ||
| 613 | // clang-format on | ||
| 614 | |||
| 615 | RegisterHandlers(functions); | ||
| 616 | } | ||
| 617 | |||
| 618 | private: | ||
| 619 | void NeedsUpdateVulnerability(HLERequestContext& ctx) { | ||
| 620 | LOG_WARNING(Service_NS, "(STUBBED) called"); | ||
| 621 | |||
| 622 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 623 | rb.Push(ResultSuccess); | ||
| 624 | rb.Push(false); | ||
| 625 | } | ||
| 626 | }; | ||
| 627 | |||
| 628 | void LoopProcess(Core::System& system) { | 605 | void LoopProcess(Core::System& system) { |
| 629 | auto server_manager = std::make_unique<ServerManager>(system); | 606 | auto server_manager = std::make_unique<ServerManager>(system); |
| 630 | 607 | ||
| @@ -637,7 +614,8 @@ void LoopProcess(Core::System& system) { | |||
| 637 | 614 | ||
| 638 | server_manager->RegisterNamedService("ns:dev", std::make_shared<NS_DEV>(system)); | 615 | server_manager->RegisterNamedService("ns:dev", std::make_shared<NS_DEV>(system)); |
| 639 | server_manager->RegisterNamedService("ns:su", std::make_shared<NS_SU>(system)); | 616 | server_manager->RegisterNamedService("ns:su", std::make_shared<NS_SU>(system)); |
| 640 | server_manager->RegisterNamedService("ns:vm", std::make_shared<NS_VM>(system)); | 617 | server_manager->RegisterNamedService("ns:vm", |
| 618 | std::make_shared<IVulnerabilityManagerInterface>(system)); | ||
| 641 | server_manager->RegisterNamedService("pdm:qry", std::make_shared<PDM_QRY>(system)); | 619 | server_manager->RegisterNamedService("pdm:qry", std::make_shared<PDM_QRY>(system)); |
| 642 | 620 | ||
| 643 | server_manager->RegisterNamedService("pl:s", | 621 | server_manager->RegisterNamedService("pl:s", |
diff --git a/src/core/hle/service/ns/vulnerability_manager_interface.cpp b/src/core/hle/service/ns/vulnerability_manager_interface.cpp new file mode 100644 index 000000000..69c21fb89 --- /dev/null +++ b/src/core/hle/service/ns/vulnerability_manager_interface.cpp | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "core/hle/service/cmif_serialization.h" | ||
| 5 | #include "core/hle/service/ns/vulnerability_manager_interface.h" | ||
| 6 | |||
| 7 | namespace Service::NS { | ||
| 8 | |||
| 9 | IVulnerabilityManagerInterface::IVulnerabilityManagerInterface(Core::System& system_) | ||
| 10 | : ServiceFramework{system_, "ns:vm"} { | ||
| 11 | // clang-format off | ||
| 12 | static const FunctionInfo functions[] = { | ||
| 13 | {1200, D<&IVulnerabilityManagerInterface::NeedsUpdateVulnerability>, "NeedsUpdateVulnerability"}, | ||
| 14 | {1201, nullptr, "UpdateSafeSystemVersionForDebug"}, | ||
| 15 | {1202, nullptr, "GetSafeSystemVersion"}, | ||
| 16 | }; | ||
| 17 | // clang-format on | ||
| 18 | |||
| 19 | RegisterHandlers(functions); | ||
| 20 | } | ||
| 21 | |||
| 22 | IVulnerabilityManagerInterface::~IVulnerabilityManagerInterface() = default; | ||
| 23 | |||
| 24 | Result IVulnerabilityManagerInterface::NeedsUpdateVulnerability( | ||
| 25 | Out<bool> out_needs_update_vulnerability) { | ||
| 26 | LOG_WARNING(Service_NS, "(STUBBED) called"); | ||
| 27 | *out_needs_update_vulnerability = false; | ||
| 28 | R_SUCCEED(); | ||
| 29 | } | ||
| 30 | |||
| 31 | } // namespace Service::NS | ||
diff --git a/src/core/hle/service/ns/vulnerability_manager_interface.h b/src/core/hle/service/ns/vulnerability_manager_interface.h new file mode 100644 index 000000000..c689cf7ec --- /dev/null +++ b/src/core/hle/service/ns/vulnerability_manager_interface.h | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "core/hle/service/cmif_types.h" | ||
| 7 | #include "core/hle/service/service.h" | ||
| 8 | |||
| 9 | namespace Service::NS { | ||
| 10 | |||
| 11 | class IVulnerabilityManagerInterface final | ||
| 12 | : public ServiceFramework<IVulnerabilityManagerInterface> { | ||
| 13 | public: | ||
| 14 | explicit IVulnerabilityManagerInterface(Core::System& system_); | ||
| 15 | ~IVulnerabilityManagerInterface() override; | ||
| 16 | |||
| 17 | private: | ||
| 18 | Result NeedsUpdateVulnerability(Out<bool> out_needs_update_vulnerability); | ||
| 19 | }; | ||
| 20 | |||
| 21 | } // namespace Service::NS | ||