stratosphere: custom exception handlers (reboot to fusee)

This commit is contained in:
Michael Scire
2019-04-12 15:28:46 -07:00
parent b03a778611
commit ac07971211
23 changed files with 307 additions and 11 deletions

View File

@@ -28,6 +28,35 @@
#define PANIC_CODE_SAFEMODE 0x00000020
/* Atmosphere reboot-to-fatal-error. */
typedef struct {
uint32_t magic;
uint32_t error_desc;
uint64_t title_id;
union {
uint64_t gprs[32];
struct {
uint64_t _gprs[29];
uint64_t fp;
uint64_t lr;
uint64_t sp;
};
};
uint64_t pc;
uint64_t padding;
uint32_t pstate;
uint32_t afsr0;
uint32_t afsr1;
uint32_t esr;
uint64_t far;
uint64_t report_identifier; /* Normally just system tick. */
} atmosphere_fatal_error_ctx;
/* "AFE0" */
#define ATMOSPHERE_REBOOT_TO_FATAL_MAGIC 0x30454641
#define ATMOSPHERE_FATAL_ERROR_CONTEXT ((volatile atmosphere_fatal_error_ctx *)(0x4003E000))
void check_and_display_panic(void);
__attribute__ ((noreturn)) void panic(uint32_t code);