Files
ss/include/rvl/OS/OSContext.h
T
Elijah Thomas 26af4db82d update from dtk-template - clangd :) (#66)
* update from dtk-template and start work towards using clangd

* include <a> -> "a"

* Update build.yml

* remove/add non-trivial class in union warning
2024-10-16 15:36:02 -04:00

47 lines
1.2 KiB
C

#ifndef RVL_SDK_OS_CONTEXT_H
#define RVL_SDK_OS_CONTEXT_H
#include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
OS_CONTEXT_STATE_FP_SAVED = (1 << 0),
} OSContextState;
typedef struct OSContext {
u32 gprs[32]; // at 0x0
u32 cr; // at 0x80
u32 lr; // at 0x84
u32 ctr; // at 0x88
u32 xer; // at 0x8C
f64 fprs[32]; // at 0x90
u32 fpscr_pad; // at 0x190
u32 fpscr; // at 0x194
u32 srr0; // at 0x198
u32 srr1; // at 0x19C
u16 mode; // at 0x1A0
u16 state; // at 0x1A2
u32 gqrs[8]; // at 0x1A4
u32 psf_pad; // at 0x1C4
f64 psfs[32]; // at 0x1C8
} OSContext;
void OSSaveFPUContext(OSContext *ctx);
void OSSetCurrentContext(OSContext *ctx);
OSContext *OSGetCurrentContext(void);
BOOL OSSaveContext(OSContext *ctx);
void OSLoadContext(OSContext *ctx);
void *OSGetStackPointer(void);
void OSSwitchFiber(void *func, void *stack);
void OSSwitchFiberEx(u32 r3, u32 r4, u32 r5, u32 r6, void *func, void *stack);
void OSClearContext(OSContext *ctx);
void OSInitContext(OSContext *ctx, void *_srr0, void *stack);
void OSDumpContext(const OSContext *ctx);
void __OSContextInit(void);
#ifdef __cplusplus
}
#endif
#endif