kern: fix race-crash on interrupt controller save, improve fatal output

This commit is contained in:
Michael Scire 2020-12-01 13:56:01 -08:00 committed by SciresM
parent 783f1077be
commit 19a279ce45
2 changed files with 5 additions and 3 deletions

View file

@ -79,9 +79,6 @@ namespace ams::kern::arch::arm {
/* Setup all interrupt lines. */ /* Setup all interrupt lines. */
SetupInterruptLines(core_id); SetupInterruptLines(core_id);
this->gicd = nullptr;
this->gicc = nullptr;
} }
void KInterruptController::SaveCoreLocal(LocalState *state) const { void KInterruptController::SaveCoreLocal(LocalState *state) const {

View file

@ -570,11 +570,16 @@ namespace ams::kern::board::nintendo::nx {
f_ctx->afsr0 = 0; f_ctx->afsr0 = 0;
f_ctx->afsr1 = GetVersionIdentifier(); f_ctx->afsr1 = GetVersionIdentifier();
/* Set efsr/far. */
f_ctx->far = cpu::GetFarEl1();
f_ctx->esr = cpu::GetEsrEl1();
/* Copy registers. */ /* Copy registers. */
for (size_t i = 0; i < util::size(e_ctx->x); ++i) { for (size_t i = 0; i < util::size(e_ctx->x); ++i) {
f_ctx->gprs[i] = e_ctx->x[i]; f_ctx->gprs[i] = e_ctx->x[i];
} }
f_ctx->sp = e_ctx->sp; f_ctx->sp = e_ctx->sp;
f_ctx->pc = cpu::GetElrEl1();
/* Dump stack trace. */ /* Dump stack trace. */
{ {