wut  1.0.0-beta9
Wii U Toolchain
coroutine.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef struct OSCoroutine OSCoroutine;
15 
17 {
18  uint32_t nia;
19  uint32_t cr;
20  uint32_t ugqr1;
21  uint32_t stack;
22  uint32_t sda2Base;
23  uint32_t sdaBase;
24  uint32_t gpr[18];
25  double fpr[18];
26  double psr[18];
27 };
28 WUT_CHECK_OFFSET(OSCoroutine, 0x00, nia);
29 WUT_CHECK_OFFSET(OSCoroutine, 0x04, cr);
30 WUT_CHECK_OFFSET(OSCoroutine, 0x08, ugqr1);
31 WUT_CHECK_OFFSET(OSCoroutine, 0x0C, stack);
32 WUT_CHECK_OFFSET(OSCoroutine, 0x10, sda2Base);
33 WUT_CHECK_OFFSET(OSCoroutine, 0x14, sdaBase);
34 WUT_CHECK_OFFSET(OSCoroutine, 0x18, gpr);
35 WUT_CHECK_OFFSET(OSCoroutine, 0x60, fpr);
36 WUT_CHECK_OFFSET(OSCoroutine, 0xF0, psr);
37 WUT_CHECK_SIZE(OSCoroutine, 0x180);
38 
39 void
40 OSInitCoroutine(OSCoroutine *coroutine,
41  void *entry,
42  void *stack);
43 
44 uint32_t
45 OSLoadCoroutine(OSCoroutine *coroutine,
46  uint32_t result);
47 
48 uint32_t
49 OSSaveCoroutine(OSCoroutine *coroutine);
50 
51 void
53  OSCoroutine *to);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
OSCoroutine::sda2Base
uint32_t sda2Base
Definition: coroutine.h:22
OSCoroutine::fpr
double fpr[18]
Definition: coroutine.h:25
OSCoroutine::gpr
uint32_t gpr[18]
Definition: coroutine.h:24
wut.h
OSCoroutine::sdaBase
uint32_t sdaBase
Definition: coroutine.h:23
OSCoroutine::ugqr1
uint32_t ugqr1
Definition: coroutine.h:20
OSCoroutine::nia
uint32_t nia
Definition: coroutine.h:18
OSCoroutine::cr
uint32_t cr
Definition: coroutine.h:19
OSSaveCoroutine
uint32_t OSSaveCoroutine(OSCoroutine *coroutine)
OSInitCoroutine
void OSInitCoroutine(OSCoroutine *coroutine, void *entry, void *stack)
OSCoroutine::stack
uint32_t stack
Definition: coroutine.h:21
OSCoroutine
Definition: coroutine.h:16
OSSwitchCoroutine
void OSSwitchCoroutine(OSCoroutine *from, OSCoroutine *to)
OSLoadCoroutine
uint32_t OSLoadCoroutine(OSCoroutine *coroutine, uint32_t result)
OSCoroutine::psr
double psr[18]
Definition: coroutine.h:26