From a35d0de5a6a425c1410bc83c92ee3db3d410fff5 Mon Sep 17 00:00:00 2001 From: Zephyron Date: Tue, 20 May 2025 17:58:38 +1000 Subject: [PATCH] feat(service/pm): Align PM services with Switchbrew documentation - **pm:bm (IBootModeInterface):** - Added stubs for Cmd 2 (`[19.0.0+]`) and Cmd 3 (`[19.0.0+]`) as "UnknownCmd2" and "UnknownCmd3" respectively. - **pm:dmnt (IDebugMonitorInterface):** - Corrected typo in Cmd 5 name from "HookToCreateApplicationProgress" to "HookToCreateApplicationProcess". - Added stub for Cmd 7 (`GetProgramId`, `[14.0.0+]`). - **pm:info (IInformationInterface):** - Added stub for Cmd 1 (`GetAppletCurrentResourceLimitValues`, `[14.0.0+]`). - Added stub for Cmd 2 (`GetAppletPeakResourceLimitValues`, `[14.0.0+]`). - **pm:shell (IShellInterface):** - Added stub for Cmd 10 (`BoostSystemThreadResourceLimit`, `[14.0.0+]`). - Added stub for Cmd 12 (`GetProcessId`, `[19.0.0+]`). Signed-off-by: Zephyron --- src/core/hle/service/pm/pm.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index b52468e41..53a52b1f0 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project +// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #include "core/core.h" @@ -52,6 +53,8 @@ public: static const FunctionInfo functions[] = { {0, &BootMode::GetBootMode, "GetBootMode"}, {1, &BootMode::SetMaintenanceBoot, "SetMaintenanceBoot"}, + {2, nullptr, "UnknownCmd2"}, + {3, nullptr, "UnknownCmd3"}, }; RegisterHandlers(functions); } @@ -87,8 +90,9 @@ public: {2, &DebugMonitor::GetProcessId, "GetProcessId"}, {3, nullptr, "HookToCreateProcess"}, {4, &DebugMonitor::GetApplicationProcessId, "GetApplicationProcessId"}, - {5, nullptr, "HookToCreateApplicationProgress"}, + {5, nullptr, "HookToCreateApplicationProcess"}, {6, nullptr, "ClearHook"}, + {7, nullptr, "GetProgramId"}, {65000, &DebugMonitor::AtmosphereGetProcessInfo, "AtmosphereGetProcessInfo"}, {65001, nullptr, "AtmosphereGetCurrentLimitInfo"}, }; @@ -173,6 +177,8 @@ public: explicit Info(Core::System& system_) : ServiceFramework{system_, "pm:info"} { static const FunctionInfo functions[] = { {0, &Info::GetProgramId, "GetProgramId"}, + {1, nullptr, "GetAppletCurrentResourceLimitValues"}, + {2, nullptr, "GetAppletPeakResourceLimitValues"}, {65000, &Info::AtmosphereGetProcessId, "AtmosphereGetProcessId"}, {65001, nullptr, "AtmosphereHasLaunchedProgram"}, {65002, nullptr, "AtmosphereGetProcessInfo"}, @@ -239,6 +245,8 @@ public: {7, nullptr, "BoostSystemMemoryResourceLimit"}, {8, nullptr, "BoostApplicationThreadResourceLimit"}, {9, nullptr, "GetBootFinishedEventHandle"}, + {10, nullptr, "BoostSystemThreadResourceLimit"}, + {12, nullptr, "GetProcessId"}, }; // clang-format on