wut  1.0.0-beta9
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;
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 
101 #ifdef __cplusplus
102 }
103 #endif
104 
OSFunctionType
OSFunctionType
Definition: messagequeue.h:25
OSMessageQueue::sendQueue
OSThreadQueue sendQueue
Definition: messagequeue.h:56
OS_MESSAGE_FLAGS_HIGH_PRIORITY
@ OS_MESSAGE_FLAGS_HIGH_PRIORITY
Definition: messagequeue.h:22
OS_FUNCTION_TYPE_FS_ATTACH_EVENT
@ OS_FUNCTION_TYPE_FS_ATTACH_EVENT
Definition: messagequeue.h:36
OS_MESSAGE_FLAGS_BLOCKING
@ OS_MESSAGE_FLAGS_BLOCKING
Definition: messagequeue.h:21
OSGetSystemMessageQueue
OSMessageQueue * OSGetSystemMessageQueue()
OSMessageFlags
OSMessageFlags
Definition: messagequeue.h:18
OSMessageQueue::name
const char * name
Definition: messagequeue.h:54
OSMessageQueue
Definition: messagequeue.h:51
OS_FUNCTION_TYPE_FSA_CMD_ASYNC
@ OS_FUNCTION_TYPE_FSA_CMD_ASYNC
Definition: messagequeue.h:30
OSMessage::args
uint32_t args[3]
Definition: messagequeue.h:43
OSMessageQueue::size
uint32_t size
Definition: messagequeue.h:59
threadqueue.h
OSPeekMessage
BOOL OSPeekMessage(OSMessageQueue *queue, OSMessage *message)
wut.h
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC
@ OS_FUNCTION_TYPE_HIO_WRITE_ASYNC
Definition: messagequeue.h:29
OSReceiveMessage
BOOL OSReceiveMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags)
OSInitMessageQueueEx
void OSInitMessageQueueEx(OSMessageQueue *queue, OSMessage *messages, int32_t size, const char *name)
OSMessageQueue::tag
uint32_t tag
Definition: messagequeue.h:53
OSMessageQueue::first
uint32_t first
Definition: messagequeue.h:60
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC
@ OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC
Definition: messagequeue.h:32
OS_MESSAGE_FLAGS_NONE
@ OS_MESSAGE_FLAGS_NONE
Definition: messagequeue.h:20
OSMessageQueue::used
uint32_t used
Definition: messagequeue.h:61
OS_FUNCTION_TYPE_FS_CMD_HANDLER
@ OS_FUNCTION_TYPE_FS_CMD_HANDLER
Definition: messagequeue.h:35
OSSendMessage
BOOL OSSendMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags)
OSMessage::message
void * message
Definition: messagequeue.h:42
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC
@ OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC
Definition: messagequeue.h:31
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT
@ OS_FUNCTION_TYPE_FSA_ATTACH_EVENT
Definition: messagequeue.h:33
OS_FUNCTION_TYPE_HIO_READ_ASYNC
@ OS_FUNCTION_TYPE_HIO_READ_ASYNC
Definition: messagequeue.h:28
OSInitMessageQueue
void OSInitMessageQueue(OSMessageQueue *queue, OSMessage *messages, int32_t size)
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT
@ OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT
Definition: messagequeue.h:37
BOOL
int32_t BOOL
Definition: wut_types.h:4
OS_FUNCTION_TYPE_HIO_OPEN
@ OS_FUNCTION_TYPE_HIO_OPEN
Definition: messagequeue.h:27
OSThreadQueue
Definition: threadqueue.h:29
OSMessageQueue::messages
OSMessage * messages
Definition: messagequeue.h:58
OSMessageQueue::recvQueue
OSThreadQueue recvQueue
Definition: messagequeue.h:57
OS_FUNCTION_TYPE_FS_CMD_ASYNC
@ OS_FUNCTION_TYPE_FS_CMD_ASYNC
Definition: messagequeue.h:34
OSMessage
Definition: messagequeue.h:40