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 typedef uint32_t OSEventMode;
22 
23 enum OSEventMode
24 {
27 
30 };
31 
32 #define OS_EVENT_TAG 0x65566E54u
33 
34 struct OSEvent
35 {
37  uint32_t tag;
38 
40  const char *name;
41 
42  UNKNOWN(4);
43 
46 
49 
51  OSEventMode mode;
52 };
53 CHECK_OFFSET(OSEvent, 0x0, tag);
54 CHECK_OFFSET(OSEvent, 0x4, name);
55 CHECK_OFFSET(OSEvent, 0xc, value);
56 CHECK_OFFSET(OSEvent, 0x10, queue);
57 CHECK_OFFSET(OSEvent, 0x20, mode);
58 CHECK_SIZE(OSEvent, 0x24);
59 
60 #pragma pack(pop)
61 
62 
66 void
67 OSInitEvent(OSEvent *event,
68  BOOL value,
69  OSEventMode mode);
70 
71 
75 void
76 OSInitEventEx(OSEvent *event,
77  BOOL value,
78  OSEventMode mode,
79  char *name);
80 
81 
95 void
96 OSSignalEvent(OSEvent *event);
97 
109 void
110 OSSignalEventAll(OSEvent *event);
111 
112 
123 void
124 OSWaitEvent(OSEvent *event);
125 
126 
132 void
133 OSResetEvent(OSEvent *event);
134 
135 
141 BOOL
143  OSTime timeout);
144 
145 #ifdef __cplusplus
146 }
147 #endif
148 
int64_t OSTime
Definition: time.h:17
void OSResetEvent(OSEvent *event)
A manual event will only reset when OSResetEvent is called.
Definition: event.h:26
void OSSignalEvent(OSEvent *event)
void OSInitEvent(OSEvent *event, BOOL value, OSEventMode mode)
const char * name
Name set by OSInitEventEx.
Definition: event.h:40
void OSSignalEventAll(OSEvent *event)
BOOL value
The current value of the event object.
Definition: event.h:45
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:37
OSEventMode
Definition: event.h:23
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:29
OSEventMode mode
The mode of the event object, set by OSInitEvent.
Definition: event.h:51
Definition: event.h:34
OSThreadQueue queue
The threads currently waiting on this event object with OSWaitEvent.
Definition: event.h:48