mirror of
https://github.com/wiiu-env/wut.git
synced 2025-01-06 15:08:13 +01:00
Add coreinit coroutine API.
This commit is contained in:
parent
5c91545658
commit
075d80aec8
59
include/coreinit/coroutine.h
Normal file
59
include/coreinit/coroutine.h
Normal file
@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
#include <wut.h>
|
||||
|
||||
/**
|
||||
* \defgroup coreinit_coroutine Coroutines
|
||||
* \ingroup coreinit
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OSCoroutine OSCoroutine;
|
||||
|
||||
struct OSCoroutine
|
||||
{
|
||||
uint32_t nia;
|
||||
uint32_t cr;
|
||||
uint32_t ugqr1;
|
||||
uint32_t stack;
|
||||
uint32_t sda2Base;
|
||||
uint32_t sdaBase;
|
||||
uint32_t gpr[18];
|
||||
double fpr[18];
|
||||
double psr[18];
|
||||
};
|
||||
CHECK_OFFSET(OSCoroutine, 0x00, nia);
|
||||
CHECK_OFFSET(OSCoroutine, 0x04, cr);
|
||||
CHECK_OFFSET(OSCoroutine, 0x08, ugqr1);
|
||||
CHECK_OFFSET(OSCoroutine, 0x0C, stack);
|
||||
CHECK_OFFSET(OSCoroutine, 0x10, sda2Base);
|
||||
CHECK_OFFSET(OSCoroutine, 0x14, sdaBase);
|
||||
CHECK_OFFSET(OSCoroutine, 0x18, gpr);
|
||||
CHECK_OFFSET(OSCoroutine, 0x60, fpr);
|
||||
CHECK_OFFSET(OSCoroutine, 0xF0, psr);
|
||||
CHECK_SIZE(OSCoroutine, 0x180);
|
||||
|
||||
void
|
||||
OSInitCoroutine(OSCoroutine *coroutine,
|
||||
void *entry,
|
||||
void *stack);
|
||||
|
||||
uint32_t
|
||||
OSLoadCoroutine(OSCoroutine *coroutine,
|
||||
uint32_t result);
|
||||
|
||||
uint32_t
|
||||
OSSaveCoroutine(OSCoroutine *coroutine);
|
||||
|
||||
void
|
||||
OSSwitchCoroutine(OSCoroutine *from,
|
||||
OSCoroutine *to);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
@ -51,6 +51,12 @@ EXPORT(OSGetCoreId);
|
||||
EXPORT(OSGetMainCoreId);
|
||||
EXPORT(OSIsMainCore);
|
||||
|
||||
// coreinit/coroutine.h
|
||||
EXPORT(OSInitCoroutine);
|
||||
EXPORT(OSLoadCoroutine);
|
||||
EXPORT(OSSaveCoroutine);
|
||||
EXPORT(OSSwitchCoroutine);
|
||||
|
||||
// coreinit/debug.h
|
||||
EXPORT(OSConsoleWrite);
|
||||
EXPORT(OSReport);
|
||||
|
Loading…
Reference in New Issue
Block a user