wut v1.9.1
Wii U Toolchain
Loading...
Searching...
No Matches
ipcbufpool.h
Go to the documentation of this file.
1#pragma once
2
3#include <wut.h>
4#include "ios.h"
5#include "mutex.h"
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
13typedef struct IPCBufPool IPCBufPool;
14
21{
23 int32_t pushIndex;
24
26 int32_t popIndex;
27
29 int32_t count;
30
32 int32_t maxCount;
33
35 void **messages;
36};
37WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x00, pushIndex);
38WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x04, popIndex);
39WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x08, count);
40WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x0C, maxCount);
41WUT_CHECK_OFFSET(IPCBufPoolFIFO, 0x10, messages);
42WUT_CHECK_SIZE(IPCBufPoolFIFO, 0x14);
43
48{
50 uint32_t messageSize;
51
53 uint32_t poolSize;
54
56 uint32_t numMessages;
57};
58WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x00, messageSize);
59WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x04, poolSize);
60WUT_CHECK_OFFSET(IPCBufPoolAttributes, 0x08, numMessages);
61WUT_CHECK_SIZE(IPCBufPoolAttributes, 0x0C);
62
63#define IPC_BUF_POOL_MAGIC 0x0BADF00Du
64
69{
71 uint32_t magic;
72
74 void *buffer;
75
77 uint32_t size;
78
79 uint32_t unk0x0C;
80 uint32_t unk0x10;
81
84
87
89 uint32_t messageCount;
90
92 void *messages;
93
96
99
102
103 WUT_UNKNOWN_BYTES(0x04);
104};
105WUT_CHECK_OFFSET(IPCBufPool, 0x00, magic);
106WUT_CHECK_OFFSET(IPCBufPool, 0x04, buffer);
107WUT_CHECK_OFFSET(IPCBufPool, 0x08, size);
108WUT_CHECK_OFFSET(IPCBufPool, 0x0C, unk0x0C);
109WUT_CHECK_OFFSET(IPCBufPool, 0x10, unk0x10);
110WUT_CHECK_OFFSET(IPCBufPool, 0x14, messageSize0x14);
111WUT_CHECK_OFFSET(IPCBufPool, 0x18, messageSize0x18);
112WUT_CHECK_OFFSET(IPCBufPool, 0x1C, messageCount);
113WUT_CHECK_OFFSET(IPCBufPool, 0x20, messages);
114WUT_CHECK_OFFSET(IPCBufPool, 0x24, messageIndexSize);
115WUT_CHECK_OFFSET(IPCBufPool, 0x28, fifo);
116WUT_CHECK_OFFSET(IPCBufPool, 0x3C, mutex);
117WUT_CHECK_SIZE(IPCBufPool, 0x6C);
118
120IPCBufPoolCreate(void *buffer,
121 uint32_t size,
122 uint32_t messageSize,
123 uint32_t *outNumMessages,
124 uint32_t unk0x0c);
125
126void *
128 uint32_t size);
129
132 void *message);
133
136 IPCBufPoolAttributes *attribs);
137
138
139#ifdef __cplusplus
140}
141#endif
IOSError
Definition ios.h:25
uint32_t * messageIndexSize
Number of bytes used for the message pointers in IPCBufPoolFIFO.
Definition ipcbufpool.h:95
uint32_t numMessages
Number of pending messages in the pool fifo.
Definition ipcbufpool.h:56
void * IPCBufPoolAllocate(IPCBufPool *pool, uint32_t size)
void ** messages
Messages in the queue.
Definition ipcbufpool.h:35
uint32_t poolSize
Size of the buffer pool.
Definition ipcbufpool.h:53
void * messages
Pointer to start of messages.
Definition ipcbufpool.h:92
void * buffer
Pointer to buffer used for this IPCBufPool.
Definition ipcbufpool.h:74
int32_t count
The number of messages in the queue.
Definition ipcbufpool.h:29
IOSError IPCBufPoolFree(IPCBufPool *pool, void *message)
uint32_t magic
Magic header always set to IPCBufPool::MagicHeader.
Definition ipcbufpool.h:71
uint32_t unk0x0C
Definition ipcbufpool.h:79
int32_t popIndex
The current message index to pop from.
Definition ipcbufpool.h:26
uint32_t unk0x10
Definition ipcbufpool.h:80
uint32_t messageSize0x14
Message size from IPCBufPoolCreate.
Definition ipcbufpool.h:83
uint32_t size
Size of buffer.
Definition ipcbufpool.h:77
int32_t maxCount
Tracks the total number of messages in the count.
Definition ipcbufpool.h:32
uint32_t messageSize0x18
Message size from IPCBufPoolCreate.
Definition ipcbufpool.h:86
OSMutex mutex
Mutex used to secure access to fifo.
Definition ipcbufpool.h:101
IPCBufPool * IPCBufPoolCreate(void *buffer, uint32_t size, uint32_t messageSize, uint32_t *outNumMessages, uint32_t unk0x0c)
IPCBufPoolFIFO fifo
FIFO queue of messages.
Definition ipcbufpool.h:98
int32_t pushIndex
The current message index to push to.
Definition ipcbufpool.h:23
uint32_t messageCount
Number of messages in the IPCBufPoolFIFO.
Definition ipcbufpool.h:89
IOSError IPCBufPoolGetAttributes(IPCBufPool *pool, IPCBufPoolAttributes *attribs)
uint32_t messageSize
Size of a message in the buffer pool.
Definition ipcbufpool.h:50
A simple message buffer pool used for IPC communication.
Definition ipcbufpool.h:69
Attributes returned by IPCBufPoolGetAttributes.
Definition ipcbufpool.h:48
FIFO queue for IPCBufPool.
Definition ipcbufpool.h:21