summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Liam2024-02-17 13:54:36 -0500
committerGravatar Liam2024-02-18 10:32:21 -0500
commit626f2e65b1a799d3e5c517d480a4691176fbe8d6 (patch)
treeb23c45a1330acab0ed8282697328422e5437385b
parentns: rewrite IReadOnlyApplicationControlDataInterface (diff)
downloadyuzu-626f2e65b1a799d3e5c517d480a4691176fbe8d6.tar.gz
yuzu-626f2e65b1a799d3e5c517d480a4691176fbe8d6.tar.xz
yuzu-626f2e65b1a799d3e5c517d480a4691176fbe8d6.zip
ns: rewrite IVulnerabilityManagerInterface
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/ns/ns.cpp28
-rw-r--r--src/core/hle/service/ns/vulnerability_manager_interface.cpp31
-rw-r--r--src/core/hle/service/ns/vulnerability_manager_interface.h21
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
604class NS_VM final : public ServiceFramework<NS_VM> {
605public:
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
618private:
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
628void LoopProcess(Core::System& system) { 605void 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
7namespace Service::NS {
8
9IVulnerabilityManagerInterface::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
22IVulnerabilityManagerInterface::~IVulnerabilityManagerInterface() = default;
23
24Result 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
9namespace Service::NS {
10
11class IVulnerabilityManagerInterface final
12 : public ServiceFramework<IVulnerabilityManagerInterface> {
13public:
14 explicit IVulnerabilityManagerInterface(Core::System& system_);
15 ~IVulnerabilityManagerInterface() override;
16
17private:
18 Result NeedsUpdateVulnerability(Out<bool> out_needs_update_vulnerability);
19};
20
21} // namespace Service::NS