From 338d7ce940f92b9888f3d83111cd04a21aff5d1f Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Wed, 11 Oct 2023 18:50:38 -0700 Subject: [PATCH] bpc.mitm/exo: support pmic reboot/shutdown on mariko (thanks @CTCaer) --- .../include/stratosphere/ams/ams_exosphere_api.hpp | 1 + libstratosphere/source/ams/ams_exosphere_api.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp b/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp index 84cdfe9a..2712b2b5 100644 --- a/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp +++ b/libstratosphere/include/stratosphere/ams/ams_exosphere_api.hpp @@ -25,6 +25,7 @@ namespace ams::exosphere { void ForceRebootToRcm(); void ForceRebootToIramPayload(); void ForceRebootToFatalError(); + void ForceRebootByPmic(); void ForceShutdown(); bool IsRcmBugPatched(); diff --git a/libstratosphere/source/ams/ams_exosphere_api.cpp b/libstratosphere/source/ams/ams_exosphere_api.cpp index 6c2a7ccc..d48b0ce5 100644 --- a/libstratosphere/source/ams/ams_exosphere_api.cpp +++ b/libstratosphere/source/ams/ams_exosphere_api.cpp @@ -39,6 +39,10 @@ namespace ams::exosphere { R_ABORT_UNLESS(spl::impl::SetConfig(spl::ConfigItem::ExosphereNeedsReboot, 3)); } + void ForceRebootByPmic() { + R_ABORT_UNLESS(spl::impl::SetConfig(spl::ConfigItem::ExosphereNeedsReboot, 4)); + } + void ForceShutdown() { R_ABORT_UNLESS(spl::impl::SetConfig(spl::ConfigItem::ExosphereNeedsShutdown, 1)); }