WUT  0.1
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 CHECK_OFFSET(OSCoroutine, 0x00, nia);
29 CHECK_OFFSET(OSCoroutine, 0x04, cr);
30 CHECK_OFFSET(OSCoroutine, 0x08, ugqr1);
31 CHECK_OFFSET(OSCoroutine, 0x0C, stack);
32 CHECK_OFFSET(OSCoroutine, 0x10, sda2Base);
33 CHECK_OFFSET(OSCoroutine, 0x14, sdaBase);
34 CHECK_OFFSET(OSCoroutine, 0x18, gpr);
35 CHECK_OFFSET(OSCoroutine, 0x60, fpr);
36 CHECK_OFFSET(OSCoroutine, 0xF0, psr);
37 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 
uint32_t nia
Definition: coroutine.h:18
double fpr[18]
Definition: coroutine.h:25
void OSInitCoroutine(OSCoroutine *coroutine, void *entry, void *stack)
uint32_t gpr[18]
Definition: coroutine.h:24
uint32_t OSLoadCoroutine(OSCoroutine *coroutine, uint32_t result)
uint32_t stack
Definition: coroutine.h:21
uint32_t OSSaveCoroutine(OSCoroutine *coroutine)
uint32_t sda2Base
Definition: coroutine.h:22
uint32_t ugqr1
Definition: coroutine.h:20
void OSSwitchCoroutine(OSCoroutine *from, OSCoroutine *to)
double psr[18]
Definition: coroutine.h:26
uint32_t sdaBase
Definition: coroutine.h:23
uint32_t cr
Definition: coroutine.h:19