1 /*---------------------------------------------------------------------------* 2 Project: OS Context API 3 File: OSContext.h 4 5 Copyright (C) Nintendo. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 *---------------------------------------------------------------------------*/ 14 15 #ifndef __OSCONTEXT_H__ 16 #define __OSCONTEXT_H__ 17 18 #include <cafe/kernel/KernelOSContext.h> 19 20 #ifndef _ASSEMBLER 21 22 #include <types.h> 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 u32 OSGetStackPointer ( void ); 28 u32 OSSwitchStack ( u32 newsp ); 29 int OSSwitchFiber ( u32 pc, u32 newsp ); 30 int OSSwitchFiberEx ( u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 pc, u32 newsp ); 31 32 void OSSetCurrentContext ( OSContext* context ); 33 OSContext* OSGetCurrentContext ( void ); 34 u32 OSSaveContext ( OSContext* context ); 35 36 void OSLoadContext ( OSContext* context ); 37 void OSClearContext ( OSContext* context ); 38 void OSInitContext ( OSContext* context, u32 pc, u32 sp ); 39 40 OSContext* OSGetCurrentFPUContext(void); 41 void OSSetCurrentFPUContext(OSContext* context); 42 43 void OSLoadFPUContext ( OSContext* context ); 44 void OSSaveFPUContext ( OSContext* context ); 45 46 void OSDumpContext ( OSContext* context ); 47 #endif // _ASSEMBLER 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif // __OSCONTEXT_H__ 54 55