finish the rest of OSContext

This commit is contained in:
Prakxo
2023-01-26 11:19:33 +00:00
parent 28034d9c89
commit 3d54e51b2a
5 changed files with 459 additions and 116 deletions
+6 -6
View File
@@ -17,8 +17,8 @@ typedef struct OSContext{
u32 fpscr;
u32 srr0;
u32 srr1;
u16 SHORT_0x1A0;
u16 SHORT_0x1A2;
u16 mode;
u16 state;
u32 gqrs[8];
char UNK_0x1C4;
f64 psfs[32];
@@ -35,11 +35,11 @@ asm BOOL OSSaveContext(OSContext*);
asm void OSLoadContext(OSContext*);
asm void* OSGetStackPointer(void);
void OSClearContext(OSContext*);
asm void OSInitContext(OSContext*);
void OSDumpContext(OSContext*);
asm void OSInitContext(register OSContext* ctx, register u32 srr, register sp);
void OSDumpContext(const OSContext*);
void __OSContextInit(void);
#ifdef __cplusplus
}
};
#endif
#endif
#endif
+32
View File
@@ -0,0 +1,32 @@
#ifndef OS_ERROR_H
#define OS_ERROR_H
#include "types.h"
#ifdef __cplusplus
extern "C"{
#endif
typedef enum {
OS_ERR_SYSTEM_RESET,
OS_ERR_MACHINE_CHECK,
OS_ERR_DSI,
OS_ERR_ISI,
OS_ERR_EXT_INTERRUPT,
OS_ERR_ALIGMENT,
OS_ERR_PROGRAM,
OS_ERR_FP_UNAVAIL,
OS_ERR_DECREMENTER,
OS_ERR_SYSTEM_CALL,
OS_ERR_TRACE,
OS_ERR_PERF_MONITOR,
OS_ERR_IABR,
OS_ERR_SMI,
OS_ERR_THERMAL_INT,
OS_ERR_PROTECTION,
OS_ERR_FP_EXCEPTION,
OS_ERR_MAX,
}
#ifdef __cplusplus
};
#endif
#endif
+8 -4
View File
@@ -2,12 +2,12 @@
#define _DOLPHIN_OS
#include "types.h"
#include "dolphin/OSContext.h"
#ifdef __cplusplus
extern "C" {
#endif
void OSReport(const char*, ...);
void OSReport(const char*, ...);
asm BOOL OSDisableInterrupts(void);
asm BOOL OSEnableInterrupts(void);
@@ -16,7 +16,11 @@ asm BOOL OSRestoreInterrupts(BOOL level);
void __RAS_OSDisableInterrupts_begin(void);
void __RAS_OSDisableInterrupts_end(void);
typedef void (*OSExceptionHandler)(u8, OSContext*);
OSExceptionHandler __OSSetExceptionHandler(u8, OSExceptionHandler);
#ifdef __cplusplus
}
};
#endif
#endif
#endif