wut
1.0.0-beta8
Wii U Toolchain
include
coreinit
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
{
20
OS_MESSAGE_FLAGS_NONE
= 0,
21
OS_MESSAGE_FLAGS_BLOCKING
= 1 << 0,
22
OS_MESSAGE_FLAGS_HIGH_PRIORITY
= 1 << 1,
23
}
OSMessageFlags
;
24
25
typedef
enum
OSFunctionType
26
{
27
OS_FUNCTION_TYPE_HIO_OPEN
= 1,
28
OS_FUNCTION_TYPE_HIO_READ_ASYNC
= 2,
29
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC
= 3,
30
OS_FUNCTION_TYPE_FSA_CMD_ASYNC
= 4,
31
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC
= 5,
32
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC
= 6,
33
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT
= 7,
34
OS_FUNCTION_TYPE_FS_CMD_ASYNC
= 8,
35
OS_FUNCTION_TYPE_FS_CMD_HANDLER
= 9,
36
OS_FUNCTION_TYPE_FS_ATTACH_EVENT
= 10,
37
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT
= 11,
38
}
OSFunctionType
;
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
51
struct
OSMessageQueue
52
{
53
uint32_t
tag
;
54
const
char
*
name
;
55
WUT_UNKNOWN_BYTES(4);
56
OSThreadQueue
sendQueue
;
57
OSThreadQueue
recvQueue
;
58
OSMessage
*
messages
;
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
74
OSInitMessageQueue
(
OSMessageQueue
*queue,
75
OSMessage
*messages,
76
int32_t size);
77
78
void
79
OSInitMessageQueueEx
(
OSMessageQueue
*queue,
80
OSMessage
*messages,
81
int32_t size,
82
const
char
*name);
83
84
BOOL
85
OSSendMessage
(
OSMessageQueue
*queue,
86
OSMessage
*message,
87
OSMessageFlags
flags);
88
89
BOOL
90
OSReceiveMessage
(
OSMessageQueue
*queue,
91
OSMessage
*message,
92
OSMessageFlags
flags);
93
94
BOOL
95
OSPeekMessage
(
OSMessageQueue
*queue,
96
OSMessage
*message);
97
98
OSMessageQueue
*
99
OSGetSystemMessageQueue
();
100
101
#ifdef __cplusplus
102
}
103
#endif
104
OSFunctionType
OSFunctionType
Definition:
messagequeue.h:25
OS_FUNCTION_TYPE_FS_STATE_CHANGE_EVENT
Definition:
messagequeue.h:37
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC_NO_ALLOC
Definition:
messagequeue.h:32
OS_MESSAGE_FLAGS_NONE
Definition:
messagequeue.h:20
OSMessageFlags
OSMessageFlags
Definition:
messagequeue.h:18
OSMessageQueue::tag
uint32_t tag
Definition:
messagequeue.h:53
OSGetSystemMessageQueue
OSMessageQueue * OSGetSystemMessageQueue()
OS_FUNCTION_TYPE_HIO_WRITE_ASYNC
Definition:
messagequeue.h:29
OSMessageQueue::used
uint32_t used
Definition:
messagequeue.h:61
OSMessageQueue::messages
OSMessage * messages
Definition:
messagequeue.h:58
OS_FUNCTION_TYPE_FS_CMD_ASYNC
Definition:
messagequeue.h:34
threadqueue.h
OS_FUNCTION_TYPE_HIO_READ_ASYNC
Definition:
messagequeue.h:28
OSMessage::message
void * message
Definition:
messagequeue.h:42
OSMessage
Definition:
messagequeue.h:40
OS_FUNCTION_TYPE_FSA_CMD_ASYNC
Definition:
messagequeue.h:30
OSPeekMessage
BOOL OSPeekMessage(OSMessageQueue *queue, OSMessage *message)
OSReceiveMessage
BOOL OSReceiveMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags)
OS_FUNCTION_TYPE_FSA_ATTACH_EVENT
Definition:
messagequeue.h:33
OSInitMessageQueueEx
void OSInitMessageQueueEx(OSMessageQueue *queue, OSMessage *messages, int32_t size, const char *name)
OSMessageQueue::name
const char * name
Definition:
messagequeue.h:54
OS_FUNCTION_TYPE_FS_ATTACH_EVENT
Definition:
messagequeue.h:36
OSMessage::args
uint32_t args[3]
Definition:
messagequeue.h:43
OSMessageQueue::size
uint32_t size
Definition:
messagequeue.h:59
wut.h
OSSendMessage
BOOL OSSendMessage(OSMessageQueue *queue, OSMessage *message, OSMessageFlags flags)
OSMessageQueue::recvQueue
OSThreadQueue recvQueue
Definition:
messagequeue.h:57
OSMessageQueue::sendQueue
OSThreadQueue sendQueue
Definition:
messagequeue.h:56
BOOL
int32_t BOOL
Definition:
wut_types.h:4
OSMessageQueue::first
uint32_t first
Definition:
messagequeue.h:60
OSInitMessageQueue
void OSInitMessageQueue(OSMessageQueue *queue, OSMessage *messages, int32_t size)
OS_FUNCTION_TYPE_FS_CMD_HANDLER
Definition:
messagequeue.h:35
OS_FUNCTION_TYPE_HIO_OPEN
Definition:
messagequeue.h:27
OS_MESSAGE_FLAGS_HIGH_PRIORITY
Definition:
messagequeue.h:22
OSThreadQueue
Definition:
threadqueue.h:29
OS_MESSAGE_FLAGS_BLOCKING
Definition:
messagequeue.h:21
OSMessageQueue
Definition:
messagequeue.h:51
OS_FUNCTION_TYPE_FSA_PR_CMD_ASYNC
Definition:
messagequeue.h:31
Generated by
1.8.15