wut  v1.7.0
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
41  void *entry,
42  void *stack);
43 
44 uint32_t
46  uint32_t result);
47 
48 uint32_t
50 
51 void
53  OSCoroutine *to);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
double fpr[18]
Definition: coroutine.h:25
uint32_t nia
Definition: coroutine.h:18
uint32_t gpr[18]
Definition: coroutine.h:24
uint32_t sdaBase
Definition: coroutine.h:23
uint32_t cr
Definition: coroutine.h:19
uint32_t sda2Base
Definition: coroutine.h:22
uint32_t stack
Definition: coroutine.h:21
uint32_t ugqr1
Definition: coroutine.h:20
double psr[18]
Definition: coroutine.h:26
uint32_t OSSaveCoroutine(OSCoroutine *coroutine)
uint32_t OSLoadCoroutine(OSCoroutine *coroutine, uint32_t result)
void OSInitCoroutine(OSCoroutine *coroutine, void *entry, void *stack)
void OSSwitchCoroutine(OSCoroutine *from, OSCoroutine *to)