From 44127faa17cff75977e3bae6e9f52dd0567e8185 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 7 May 2018 22:47:55 -0600 Subject: [PATCH] SM: Fix svcGetSystemInfo bug, now works on 5.0.2. --- stratosphere/sm/source/sm_main.cpp | 1 + stratosphere/sm/source/sm_registration.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stratosphere/sm/source/sm_main.cpp b/stratosphere/sm/source/sm_main.cpp index 21c526565..aa1fe0f8d 100644 --- a/stratosphere/sm/source/sm_main.cpp +++ b/stratosphere/sm/source/sm_main.cpp @@ -59,6 +59,7 @@ int main(int argc, char **argv) Handle smm_h; if (R_FAILED(Registration::RegisterServiceForSelf(smEncodeName("sm:m"), 1, false, &smm_h))) { /* TODO: Panic. */ + while (1) { } } server_manager->add_waitable(new ExistingPortServer(smm_h, 1)); diff --git a/stratosphere/sm/source/sm_registration.cpp b/stratosphere/sm/source/sm_registration.cpp index 15a25719f..bd76bce87 100644 --- a/stratosphere/sm/source/sm_registration.cpp +++ b/stratosphere/sm/source/sm_registration.cpp @@ -117,7 +117,7 @@ void Registration::CacheInitialProcessIdLimits() { } if (kernelAbove500()) { svcGetSystemInfo(&g_initial_process_id_low, 2, 0, 0); - svcGetSystemInfo(&g_initial_process_id_high, 2, 0, 0); + svcGetSystemInfo(&g_initial_process_id_high, 2, 0, 1); } else { g_initial_process_id_low = 0; g_initial_process_id_high = REGISTRATION_INITIAL_PID_MAX;