1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-18 08:22:04 +00:00

kern: support reboot to fatal error on mariko

This commit is contained in:
Michael Scire 2024-10-10 19:14:22 -07:00 committed by SciresM
parent e63cae5c77
commit 3522ac18c1
2 changed files with 5 additions and 9 deletions

View file

@ -623,13 +623,8 @@ namespace ams::kern::board::nintendo::nx {
for (size_t i = 0; i < RebootPayloadSize / sizeof(u32); ++i) { for (size_t i = 0; i < RebootPayloadSize / sizeof(u32); ++i) {
GetPointer<volatile u32>(iram_address)[i] = GetPointer<volatile u32>(reboot_payload)[i]; GetPointer<volatile u32>(iram_address)[i] = GetPointer<volatile u32>(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) { if (g_call_smc_on_panic) {

View file

@ -98,9 +98,10 @@ namespace ams::kern::board::nintendo::nx::smc {
}; };
enum UserRebootType { enum UserRebootType {
UserRebootType_None = 0, UserRebootType_None = 0,
UserRebootType_ToRcm = 1, UserRebootType_ToRcm = 1,
UserRebootType_ToPayload = 2, UserRebootType_ToPayload = 2,
UserRebootType_ToFatalError = 3,
}; };
void GenerateRandomBytes(void *dst, size_t size); void GenerateRandomBytes(void *dst, size_t size);