2022-10-08 05:53:41 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_OSEXCEPTION
|
|
|
|
#define _DOLPHIN_OSEXCEPTION
|
2022-10-08 05:53:41 +00:00
|
|
|
|
|
|
|
#include <dolphin/os/OSContext.h>
|
|
|
|
#include <dolphin/types.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
typedef u8 __OSException;
|
|
|
|
typedef void (*__OSExceptionHandler)(__OSException exception, OSContext* context);
|
|
|
|
|
2022-11-03 16:17:03 +00:00
|
|
|
#define OS_EXCEPTION_SAVE_GPRS(context) \
|
|
|
|
stw r0, OS_CONTEXT_R0(context); \
|
|
|
|
stw r1, OS_CONTEXT_R1(context); \
|
|
|
|
stw r2, OS_CONTEXT_R2(context); \
|
|
|
|
stmw r6, OS_CONTEXT_R6(context); \
|
|
|
|
mfspr r0, GQR1; \
|
|
|
|
stw r0, OS_CONTEXT_GQR1(context); \
|
|
|
|
mfspr r0, GQR2; \
|
|
|
|
stw r0, OS_CONTEXT_GQR2(context); \
|
|
|
|
mfspr r0, GQR3; \
|
|
|
|
stw r0, OS_CONTEXT_GQR3(context); \
|
|
|
|
mfspr r0, GQR4; \
|
|
|
|
stw r0, OS_CONTEXT_GQR4(context); \
|
|
|
|
mfspr r0, GQR5; \
|
|
|
|
stw r0, OS_CONTEXT_GQR5(context); \
|
|
|
|
mfspr r0, GQR6; \
|
|
|
|
stw r0, OS_CONTEXT_GQR6(context); \
|
|
|
|
mfspr r0, GQR7; \
|
|
|
|
stw r0, OS_CONTEXT_GQR7(context);
|
|
|
|
|
2022-10-08 05:53:41 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_OSEXCEPTION
|