exo: implement start of mariko fatal handler

This commit is contained in:
Michael Scire authored and SciresM committed 2020-11-18 15:08:44 -08:00
1 parent 123ed80dc7
commit 7bcd5c6e3b
28 files changed
+1138 -24

No files matched your search

+17 -4
View File
@@ -43,7 +43,20 @@ namespace ams::boot {
}
}
void DoRebootToPayload(ams::FatalErrorContext *ctx) {
void DoRebootToPayload() {
/* Ensure clean IRAM state. */
ClearIram();
/* Copy in payload. */
for (size_t ofs = 0; ofs < fusee_primary_bin_size; ofs += sizeof(g_work_page)) {
std::memcpy(g_work_page, &fusee_primary_bin[ofs], std::min(static_cast<size_t>(fusee_primary_bin_size - ofs), sizeof(g_work_page)));
exosphere::CopyToIram(IramPayloadBase + ofs, g_work_page, sizeof(g_work_page));
}
exosphere::ForceRebootToIramPayload();
}
void DoRebootToFatalError(ams::FatalErrorContext *ctx) {
/* Ensure clean IRAM state. */
ClearIram();
@@ -61,14 +74,14 @@ namespace ams::boot {
exosphere::CopyToIram(IramPayloadBase + IramFatalErrorContextOffset, g_work_page, sizeof(g_work_page));
}
exosphere::ForceRebootToIramPayload();
exosphere::ForceRebootToFatalError();
}
}
void RebootSystem() {
if (spl::GetSocType() == spl::SocType_Erista) {
DoRebootToPayload(nullptr);
DoRebootToPayload();
} else {
/* On Mariko, we can't reboot to payload, so we should just do a reboot. */
PmicDriver().RebootSystem();
@@ -84,7 +97,7 @@ namespace ams::boot {
}
void RebootForFatalError(ams::FatalErrorContext *ctx) {
DoRebootToPayload(ctx);
DoRebootToFatalError(ctx);
}
}