RetroArch
lwp_messages.h
Go to the documentation of this file.
1 #ifndef __LWP_MESSAGES_H__
2 #define __LWP_MESSAGES_H__
3 
4 #include <gctypes.h>
5 #include <limits.h>
6 #include <string.h>
7 #include <lwp_threadq.h>
8 
9 //#define _LWPMQ_DEBUG
10 
11 #define LWP_MQ_FIFO 0
12 #define LWP_MQ_PRIORITY 1
13 
14 #define LWP_MQ_STATUS_SUCCESSFUL 0
15 #define LWP_MQ_STATUS_INVALID_SIZE 1
16 #define LWP_MQ_STATUS_TOO_MANY 2
17 #define LWP_MQ_STATUS_UNSATISFIED 3
18 #define LWP_MQ_STATUS_UNSATISFIED_NOWAIT 4
19 #define LWP_MQ_STATUS_DELETED 5
20 #define LWP_MQ_STATUS_TIMEOUT 6
21 #define LWP_MQ_STATUS_UNSATISFIED_WAIT 7
22 
23 #define LWP_MQ_SEND_REQUEST INT_MAX
24 #define LWP_MQ_SEND_URGENT INT_MIN
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 typedef void (*mq_notifyhandler)(void *);
31 
32 typedef struct _mqbuffer {
34  u32 buffer[1];
35 } mq_buffer;
36 
37 typedef struct _mqbuffercntrl {
42 
43 //the following struct is extensible
44 typedef struct _mqattr {
46 } mq_attr;
47 
48 typedef struct _mqcntrl {
57  void *notify_arg;
59 } mq_cntrl;
60 
61 u32 __lwpmq_initialize(mq_cntrl *mqueue,mq_attr *attrs,u32 max_pendingmsgs,u32 max_msgsize);
62 void __lwpmq_close(mq_cntrl *mqueue,u32 status);
67 u32 __lwpmq_flush(mq_cntrl *mqueue);
70 
71 #ifdef LIBOGC_INTERNAL
72 #include <libogc/lwp_messages.inl>
73 #endif
74 
75 #ifdef __cplusplus
76  }
77 #endif
78 
79 #endif
Definition: lwp_messages.h:44
GLbitfield GLuint64 timeout
Definition: glext.h:7831
Definition: lwp_queue.h:21
struct _mqattr mq_attr
Data type definitions.
Definition: lwp_messages.h:37
Definition: lwp_tqdata.h:23
void __lwpmq_msg_insert(mq_cntrl *mqueue, mq_buffercntrl *msg, u32 type)
Definition: lwp_messages.c:6
GLsizeiptr size
Definition: glext.h:6559
u32 max_pendingmsgs
Definition: lwp_messages.h:51
Definition: lwp_queue.h:16
lwp_queue inactive_msgs
Definition: lwp_messages.h:58
lwp_queue pending_msgs
Definition: lwp_messages.h:54
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
GLuint GLuint GLsizei count
Definition: glext.h:6292
Definition: lwp_messages.h:32
GLenum type
Definition: glext.h:6233
u32 max_msgsize
Definition: lwp_messages.h:53
static const unsigned char msg[]
Definition: ccm.c:375
u32 num_pendingmsgs
Definition: lwp_messages.h:52
mq_notifyhandler notify_handler
Definition: lwp_messages.h:56
u32 __lwpmq_flush_support(mq_cntrl *mqueue)
Definition: lwp_messages.c:227
mq_buffer contents
Definition: lwp_messages.h:40
lwp_node node
Definition: lwp_messages.h:38
u32 __lwpmq_submit(mq_cntrl *mqueue, u32 id, void *buffer, u32 size, u32 type, u32 wait, u64 timeout)
Definition: lwp_messages.c:129
u32 __lwpmq_broadcast(mq_cntrl *mqueue, void *buffer, u32 size, u32 id, u32 *count)
Definition: lwp_messages.c:182
uint64_t u64
64bit unsigned integer
Definition: gctypes.h:20
mq_buffer * msq_buffers
Definition: lwp_messages.h:55
Definition: lwp_messages.h:48
u32 size
Definition: lwp_messages.h:33
lwp_thrqueue wait_queue
Definition: lwp_messages.h:49
int wait
Definition: wiiuse_internal.h:334
u32 __lwpmq_seize(mq_cntrl *mqueue, u32 id, void *buffer, u32 *size, u32 wait, u64 timeout)
Definition: lwp_messages.c:76
struct _mqbuffer mq_buffer
struct _mqcntrl mq_cntrl
Definition: video4linux2.c:51
u32 prio
Definition: lwp_messages.h:39
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
u32 __lwpmq_flush(mq_cntrl *mqueue)
Definition: lwp_messages.c:219
u32 mode
Definition: lwp_messages.h:45
u32 __lwpmq_initialize(mq_cntrl *mqueue, mq_attr *attrs, u32 max_pendingmsgs, u32 max_msgsize)
Definition: lwp_messages.c:47
void __lwpmq_close(mq_cntrl *mqueue, u32 status)
Definition: lwp_messages.c:212
void(* mq_notifyhandler)(void *)
Definition: lwp_messages.h:30
void __lwpmq_flush_waitthreads(mq_cntrl *mqueue)
Definition: lwp_messages.c:255
struct _mqbuffercntrl mq_buffercntrl
mq_attr attr
Definition: lwp_messages.h:50
void * notify_arg
Definition: lwp_messages.h:57