NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
OSInterrupt.h
1#ifndef RVL_SDK_OS_INTERRUPT_H
2#define RVL_SDK_OS_INTERRUPT_H
3#include <types.h>
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8// Forward declarations
9typedef struct OSContext OSContext;
10
11// Create mask from interrupt ID
12#define OS_INTR_MASK(intr) (1 << (31 - intr))
13
14typedef enum {
15 OS_INTR_MEM_0,
16 OS_INTR_MEM_1,
17 OS_INTR_MEM_2,
18 OS_INTR_MEM_3,
19 OS_INTR_MEM_ADDRESS,
20 OS_INTR_DSP_AI,
21 OS_INTR_DSP_ARAM,
22 OS_INTR_DSP_DSP,
23 OS_INTR_AI_AI,
24 OS_INTR_EXI_0_EXI,
25 OS_INTR_EXI_0_TC,
26 OS_INTR_EXI_0_EXT,
27 OS_INTR_EXI_1_EXI,
28 OS_INTR_EXI_1_TC,
29 OS_INTR_EXI_1_EXT,
30 OS_INTR_EXI_2_EXI,
31 OS_INTR_EXI_2_TC,
32 OS_INTR_PI_CP,
33 OS_INTR_PI_PE_TOKEN,
34 OS_INTR_PI_PE_FINISH,
35 OS_INTR_PI_SI,
36 OS_INTR_PI_DI,
37 OS_INTR_PI_RSW,
38 OS_INTR_PI_ERROR,
39 OS_INTR_PI_VI,
40 OS_INTR_PI_DEBUG,
41 OS_INTR_PI_HSP,
42 OS_INTR_PI_ACR,
43 OS_INTR_28,
44 OS_INTR_29,
45 OS_INTR_30,
46 OS_INTR_31,
47
48 OS_INTR_MAX
49} OSInterruptType;
50
51typedef void (*OSInterruptHandler)(s16 intr, OSContext* ctx);
52
53extern u32 __OSLastInterruptSrr0;
54extern s16 __OSLastInterrupt;
55extern s64 __OSLastInterruptTime;
56
57BOOL OSDisableInterrupts(void);
58BOOL OSEnableInterrupts(void);
59BOOL OSRestoreInterrupts(BOOL status);
60
61OSInterruptHandler __OSSetInterruptHandler(OSInterruptType type,
62 OSInterruptHandler handler);
63OSInterruptHandler __OSGetInterruptHandler(OSInterruptType type);
64
65void __OSInterruptInit(void);
66
67u32 __OSMaskInterrupts(u32 userMask);
68u32 __OSUnmaskInterrupts(u32 userMask);
69void __OSDispatchInterrupt(u8 intr, OSContext* ctx);
70
71void __RAS_OSDisableInterrupts_begin(void);
72void __RAS_OSDisableInterrupts_end(void);
73
74#ifdef __cplusplus
75}
76#endif
77#endif