WUT  0.1
Wii U Toolchain
semaphore.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include "threadqueue.h"
4 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 typedef struct OSSemaphore OSSemaphore;
16 
17 #define OS_SEMAPHORE_TAG 0x73506852u
18 
20 {
21  uint32_t tag;
22  const char *name;
23  UNKNOWN(4);
24  int32_t count;
26 };
27 CHECK_OFFSET(OSSemaphore, 0x00, tag);
28 CHECK_OFFSET(OSSemaphore, 0x04, name);
29 CHECK_OFFSET(OSSemaphore, 0x0C, count);
30 CHECK_OFFSET(OSSemaphore, 0x10, queue);
31 CHECK_SIZE(OSSemaphore, 0x20);
32 
33 void
34 OSInitSemaphore(OSSemaphore *semaphore,
35  int32_t count);
36 
37 void
39  int32_t count,
40  const char *name);
41 
42 int32_t
44 
45 int32_t
46 OSSignalSemaphore(OSSemaphore *semaphore);
47 
48 int32_t
49 OSWaitSemaphore(OSSemaphore *semaphore);
50 
51 int32_t
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
OSThreadQueue queue
Definition: semaphore.h:25
int32_t OSTryWaitSemaphore(OSSemaphore *semaphore)
const char * name
Definition: semaphore.h:22
int32_t OSWaitSemaphore(OSSemaphore *semaphore)
int32_t count
Definition: semaphore.h:24
uint32_t tag
Definition: semaphore.h:21
void OSInitSemaphoreEx(OSSemaphore *semaphore, int32_t count, const char *name)
int32_t OSSignalSemaphore(OSSemaphore *semaphore)
int32_t OSGetSemaphoreCount(OSSemaphore *semaphore)
void OSInitSemaphore(OSSemaphore *semaphore, int32_t count)