1 /*---------------------------------------------------------------------------* 2 Project: Cafe 3 File: OSEvent.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 __OSEVENT_H__ 16 #define __OSEVENT_H__ 17 18 #define OSEVENT_TXT_TAG 0x65566E54 19 20 #include <cafe/os/OSThread.h> 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 #define OS_EVENT_MANUAL 0 27 #define OS_EVENT_AUTO 1 28 29 typedef struct OSEvent 30 { 31 u32 txtTag; // eVnT 0x65566E54 32 char * name; // debug name or NULL 33 u32 os_reserved1; 34 35 BOOL state; 36 OSThreadQueue queue; 37 s32 mode; 38 } OSEvent; 39 40 void OSInitEvent(OSEvent *event, BOOL initial_state, s32 mode); 41 void OSInitEventEx(OSEvent *event, BOOL initial_state, s32 mode, char * name); 42 43 void OSSignalEvent(OSEvent *event); 44 void OSSignalEventAll(OSEvent *event); 45 void OSWaitEvent(OSEvent *event); 46 void OSResetEvent(OSEvent *event); 47 BOOL OSWaitEventWithTimeout(OSEvent *event, OSTimeNanoseconds timeout); 48 49 #ifdef __cplusplus 50 } 51 #endif 52 53 #endif // __OSEVENT_H__ 54 55