NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
OSContext.h
1#ifndef RVL_SDK_OS_CONTEXT_H
2#define RVL_SDK_OS_CONTEXT_H
3#include <types.h>
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8typedef enum {
9 OS_CONTEXT_STATE_FP_SAVED = (1 << 0),
10} OSContextState;
11
12typedef struct OSContext {
13 u32 gprs[32]; // at 0x0
14 u32 cr; // at 0x80
15 u32 lr; // at 0x84
16 u32 ctr; // at 0x88
17 u32 xer; // at 0x8C
18 f64 fprs[32]; // at 0x90
19 u32 fpscr_pad; // at 0x190
20 u32 fpscr; // at 0x194
21 u32 srr0; // at 0x198
22 u32 srr1; // at 0x19C
23 u16 mode; // at 0x1A0
24 u16 state; // at 0x1A2
25 u32 gqrs[8]; // at 0x1A4
26 u32 psf_pad; // at 0x1C4
27 f64 psfs[32]; // at 0x1C8
28} OSContext;
29
30void OSSaveFPUContext(OSContext* ctx);
31void OSSetCurrentContext(OSContext* ctx);
32OSContext* OSGetCurrentContext(void);
33BOOL OSSaveContext(OSContext* ctx);
34void OSLoadContext(OSContext* ctx);
35void* OSGetStackPointer(void);
36void OSSwitchFiber(void* func, void* stack);
37void OSSwitchFiberEx(u32 r3, u32 r4, u32 r5, u32 r6, void* func, void* stack);
38void OSClearContext(OSContext* ctx);
39void OSInitContext(OSContext* ctx, void* _srr0, void* stack);
40void OSDumpContext(const OSContext* ctx);
41void __OSContextInit(void);
42
43#ifdef __cplusplus
44}
45#endif
46#endif