WUT  0.1
Wii U Toolchain
event.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "thread.h"
4 #include "threadqueue.h"
5 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 typedef struct OSEvent OSEvent;
21 
22 typedef enum OSEventMode
23 {
26 
29 } OSEventMode;
30 
31 #define OS_EVENT_TAG 0x65566E54u
32 
33 struct OSEvent
34 {
36  uint32_t tag;
37 
39  const char *name;
40 
41  UNKNOWN(4);
42 
45 
48 
51 };
52 CHECK_OFFSET(OSEvent, 0x0, tag);
53 CHECK_OFFSET(OSEvent, 0x4, name);
54 CHECK_OFFSET(OSEvent, 0xc, value);
55 CHECK_OFFSET(OSEvent, 0x10, queue);
56 CHECK_OFFSET(OSEvent, 0x20, mode);
57 CHECK_SIZE(OSEvent, 0x24);
58 
59 #pragma pack(pop)
60 
61 
65 void
66 OSInitEvent(OSEvent *event,
67  BOOL value,
68  OSEventMode mode);
69 
70 
74 void
75 OSInitEventEx(OSEvent *event,
76  BOOL value,
77  OSEventMode mode,
78  char *name);
79 
80 
94 void
95 OSSignalEvent(OSEvent *event);
96 
108 void
109 OSSignalEventAll(OSEvent *event);
110 
111 
122 void
123 OSWaitEvent(OSEvent *event);
124 
125 
131 void
132 OSResetEvent(OSEvent *event);
133 
134 
140 BOOL
142  OSTime timeout);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
int64_t OSTime
Definition: time.h:17
void OSResetEvent(OSEvent *event)
A manual event will only reset when OSResetEvent is called.
Definition: event.h:25
void OSSignalEvent(OSEvent *event)
void OSInitEvent(OSEvent *event, BOOL value, OSEventMode mode)
const char * name
Name set by OSInitEventEx.
Definition: event.h:39
void OSSignalEventAll(OSEvent *event)
BOOL value
The current value of the event object.
Definition: event.h:44
void OSWaitEvent(OSEvent *event)
BOOL OSWaitEventWithTimeout(OSEvent *event, OSTime timeout)
uint32_t tag
Should always be set to the value OS_EVENT_TAG.
Definition: event.h:36
OSEventMode
Definition: event.h:22
void OSInitEventEx(OSEvent *event, BOOL value, OSEventMode mode, char *name)
int BOOL
Definition: wut_types.h:4
An auto event will reset everytime a thread is woken.
Definition: event.h:28
OSEventMode mode
The mode of the event object, set by OSInitEvent.
Definition: event.h:50
Definition: event.h:33
OSThreadQueue queue
The threads currently waiting on this event object with OSWaitEvent.
Definition: event.h:47