exo: shuffle logic around to support debug code region in iram

This commit is contained in:
Michael Scire 2020-11-15 01:36:50 -08:00
parent ee3a7e7740
commit 2ef41f0027
11 changed files with 86 additions and 43 deletions

View file

@ -26,7 +26,8 @@ namespace ams::boot {
constexpr uintptr_t IramBase = 0x40000000ull;
constexpr uintptr_t IramPayloadBase = 0x40010000ull;
constexpr size_t IramSize = 0x40000;
constexpr size_t IramPayloadMaxSize = 0x20000;
constexpr size_t IramPayloadMaxSize = 0x24000;
constexpr size_t IramFatalErrorContextOffset = 0x2E000;
/* Globals. */
alignas(os::MemoryPageSize) u8 g_work_page[os::MemoryPageSize];
@ -57,7 +58,7 @@ namespace ams::boot {
if (ctx != nullptr) {
std::memset(g_work_page, 0xCC, sizeof(g_work_page));
std::memcpy(g_work_page, ctx, sizeof(*ctx));
exosphere::CopyToIram(IramPayloadBase + IramPayloadMaxSize, g_work_page, sizeof(g_work_page));
exosphere::CopyToIram(IramPayloadBase + IramFatalErrorContextOffset, g_work_page, sizeof(g_work_page));
}
exosphere::ForceRebootToIramPayload();