From 5717ea6c00f551f13ae34a944ae64a4d15b71db6 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 10 Oct 2024 19:14:22 -0700 Subject: [PATCH] kern: support reboot to fatal error on mariko --- .../source/board/nintendo/nx/kern_k_system_control.cpp | 7 +------ .../source/board/nintendo/nx/kern_secure_monitor.hpp | 7 ++++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/libraries/libmesosphere/source/board/nintendo/nx/kern_k_system_control.cpp b/libraries/libmesosphere/source/board/nintendo/nx/kern_k_system_control.cpp index 8050f78e0..b82518e6e 100644 --- a/libraries/libmesosphere/source/board/nintendo/nx/kern_k_system_control.cpp +++ b/libraries/libmesosphere/source/board/nintendo/nx/kern_k_system_control.cpp @@ -623,13 +623,8 @@ namespace ams::kern::board::nintendo::nx { for (size_t i = 0; i < RebootPayloadSize / sizeof(u32); ++i) { GetPointer(iram_address)[i] = GetPointer(reboot_payload)[i]; } - - /* Reboot. */ - smc::SetConfig(smc::ConfigItem::ExosphereNeedsReboot, smc::UserRebootType_ToPayload); - } else { - /* If we don't have a payload, reboot to rcm. */ - smc::SetConfig(smc::ConfigItem::ExosphereNeedsReboot, smc::UserRebootType_ToRcm); } + smc::SetConfig(smc::ConfigItem::ExosphereNeedsReboot, smc::UserRebootType_ToFatalError); } if (g_call_smc_on_panic) { diff --git a/libraries/libmesosphere/source/board/nintendo/nx/kern_secure_monitor.hpp b/libraries/libmesosphere/source/board/nintendo/nx/kern_secure_monitor.hpp index 1e64d11f9..6ee325aa3 100644 --- a/libraries/libmesosphere/source/board/nintendo/nx/kern_secure_monitor.hpp +++ b/libraries/libmesosphere/source/board/nintendo/nx/kern_secure_monitor.hpp @@ -98,9 +98,10 @@ namespace ams::kern::board::nintendo::nx::smc { }; enum UserRebootType { - UserRebootType_None = 0, - UserRebootType_ToRcm = 1, - UserRebootType_ToPayload = 2, + UserRebootType_None = 0, + UserRebootType_ToRcm = 1, + UserRebootType_ToPayload = 2, + UserRebootType_ToFatalError = 3, }; void GenerateRandomBytes(void *dst, size_t size);