wut  v1.7.0
Wii U Toolchain
messagequeue.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 OSMessage OSMessage;
16 typedef struct OSMessageQueue OSMessageQueue;
17 
18 typedef enum OSMessageFlags
19 {
24 
25 typedef enum OSFunctionType
26 {
39 
40 struct OSMessage
41 {
42  void *message;
43  uint32_t args[3];
44 };
45 WUT_CHECK_OFFSET(OSMessage, 0x00, message);
46 WUT_CHECK_OFFSET(OSMessage, 0x04, args);
47 WUT_CHECK_SIZE(OSMessage, 0x10);
48 
49 #define OS_MESSAGE_QUEUE_TAG 0x6D536751u
50 
52 {
53  uint32_t tag;
54  const char *name;
55  WUT_UNKNOWN_BYTES(4);
59  uint32_t size;
60  uint32_t first;
61  uint32_t used;
62 };
63 WUT_CHECK_OFFSET(OSMessageQueue, 0x00, tag);
64 WUT_CHECK_OFFSET(OSMessageQueue, 0x04, name);
65 WUT_CHECK_OFFSET(OSMessageQueue, 0x0c, sendQueue);
66 WUT_CHECK_OFFSET(OSMessageQueue, 0x1c, recvQueue);
67 WUT_CHECK_OFFSET(OSMessageQueue, 0x2c, messages);
68 WUT_CHECK_OFFSET(OSMessageQueue, 0x30, size);
69 WUT_CHECK_OFFSET(OSMessageQueue, 0x34, first);
70 WUT_CHECK_OFFSET(OSMessageQueue, 0x38, used);
71 WUT_CHECK_SIZE(OSMessageQueue, 0x3c);
72 
73 void
75  OSMessage *messages,
76  int32_t size);
77 
78 void
80  OSMessage *messages,
81  int32_t size,
82  const char *name);
83 
84 BOOL
86  OSMessage *message,
87  OSMessageFlags flags);
88 
89 BOOL
91  OSMessage *message,
92  OSMessageFlags flags);
93 
94 BOOL
96  OSMessage *message);
97 
100 
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
OSThreadQueue recvQueue
Definition: messagequeue.h:57
uint32_t tag
Definition: messagequeue.h:53
uint32_t first
Definition: messagequeue.h:60
void * message
Definition: messagequeue.h:42
uint32_t used
Definition: messagequeue.h:61
const char * name
Definition: messagequeue.h:54
OSMessage * messages
Definition: messagequeue.h:58
uint32_t args[3]
Definition: messagequeue.h:43
uint32_t size
Definition: messagequeue.h:59
OSThreadQueue sendQueue
Definition: messagequeue.h:55
OSMessageQueue * OSGetDefaultAppIOQueue()
BOOL OSReceiveMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags)
OSMessageQueue * OSGetSystemMessageQueue()
BOOL OSSendMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags)
OSMessageFlags
Definition: messagequeue.h:19
void OSInitMessageQueueEx(OSMessageQueue *queue, OSMessage *messages, int32_t size, const char *name)
BOOL OSPeekMessage(OSMessageQueue *queue, OSMessage *message)
void OSInitMessageQueue(OSMessageQueue *queue, OSMessage *messages, int32_t size)
OSFunctionType
Definition: messagequeue.h:26
@ OS_MESSAGE_FLAGS_BLOCKING
Definition: messagequeue.h:21
@ OS_MESSAGE_FLAGS_HIGH_PRIORITY
Definition: messagequeue.h:22
@ OS_MESSAGE_FLAGS_NONE
Definition: messagequeue.h:20
@ OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC
Definition: messagequeue.h:31
@ OS_FUNCTION_TYPE_FSA_CMD_ASYNC
Definition: messagequeue.h:30
@ OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT
Definition: messagequeue.h:37
@ OS_FUNCTION_TYPE_HIO_READ_ASYNC
Definition: messagequeue.h:28
@ OS_FUNCTION_TYPE_FS_CMD_ASYNC
Definition: messagequeue.h:34
@ OS_FUNCTION_TYPE_FSA_ATTACH_EVENT
Definition: messagequeue.h:33
@ OS_FUNCTION_TYPE_HIO_WRITE_ASYNC
Definition: messagequeue.h:29
@ OS_FUNCTION_TYPE_FS_ATTACH_EVENT
Definition: messagequeue.h:36
@ OS_FUNCTION_TYPE_HIO_OPEN
Definition: messagequeue.h:27
@ OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC
Definition: messagequeue.h:32
@ OS_FUNCTION_TYPE_FS_CMD_HANDLER
Definition: messagequeue.h:35
int32_t BOOL
Definition: wut_types.h:7