NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
OSError.h
1#ifndef RVL_SDK_OS_ERROR_H
2#define RVL_SDK_OS_ERROR_H
3#include <types.h>
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8// Forward declarations
9typedef struct OSContext OSContext;
10
11#define OS_ERROR(...) OSPanic(__FILE__, __LINE__, __VA_ARGS__)
12
13#define OS_ASSERT(exp, ...) \
14 if (!(exp)) \
15 OSPanic(__FILE__, __LINE__, __VA_ARGS__)
16
17typedef enum {
18 OS_ERR_SYSTEM_RESET,
19 OS_ERR_MACHINE_CHECK,
20 OS_ERR_DSI,
21 OS_ERR_ISI,
22 OS_ERR_EXT_INTERRUPT,
23 OS_ERR_ALIGNMENT,
24 OS_ERR_PROGRAM,
25 OS_ERR_FP_UNAVAIL,
26 OS_ERR_DECREMENTER,
27 OS_ERR_SYSTEM_CALL,
28 OS_ERR_TRACE,
29 OS_ERR_PERF_MONITOR,
30 OS_ERR_IABR,
31 OS_ERR_SMI,
32 OS_ERR_THERMAL_INT,
33 OS_ERR_PROTECTION,
34 OS_ERR_FP_EXCEPTION,
35
36 OS_ERR_MAX
37} OSErrorType;
38
39typedef void (*OSErrorHandler)(u8 error, OSContext* ctx, u32 dsisr, u32 dar,
40 ...);
41
42extern OSErrorHandler __OSErrorTable[OS_ERR_MAX];
43extern u32 __OSFpscrEnableBits;
44
45DECL_WEAK void OSReport(const char* msg, ...);
46DECL_WEAK void OSPanic(const char* file, int line, const char* msg, ...);
47
48OSErrorHandler OSSetErrorHandler(u16 error, OSErrorHandler handler);
49void __OSUnhandledException(u8 error, OSContext* ctx, u32 dsisr, u32 dar);
50
51#ifdef __cplusplus
52}
53#endif
54#endif