/*---------------------------------------------------------------------------* Project: OS API File: OSCoroutine.h Copyright (C) Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ #ifndef __OSCOROUTINE_H__ #define __OSCOROUTINE_H__ #ifdef __cplusplus extern "C" { #endif #define VOLATILE_REG_NUM 14 #define NONVOLATILE_REG_NUM 18 typedef struct { u32 lr; u32 cr; u32 gqr1; u32 r1; // stack pointer (sp) u32 r2; // read-only small data u32 r13; // read-write small data u32 gpr[NONVOLATILE_REG_NUM]; f64 fpr[NONVOLATILE_REG_NUM]; f64 psr[NONVOLATILE_REG_NUM]; } OSCoroutine; void OSInitCoroutine(OSCoroutine *coroutine, void *pc, void *sp); void OSLoadCoroutine(OSCoroutine *coroutine, void *retval); void* OSSaveCoroutine(OSCoroutine *coroutine); void OSSwitchCoroutine(OSCoroutine *current, OSCoroutine *next); #ifdef __cplusplus } #endif #endif // __OSCOROUTINE_H__