psl1ght
A free SDK for Sony's PS3 console
event_queue.h
Go to the documentation of this file.
1 
5 #ifndef __SYS_EVENT_QUEUE_H__
6 #define __SYS_EVENT_QUEUE_H__
7 
8 #include <ppu-lv2.h>
9 
11 #define SYS_EVENT_QUEUE_PPU 0x01
12 
13 #define SYS_EVENT_QUEUE_SPU 0x02
14 
16 #define SYS_EVENT_QUEUE_FIFO 0x01
17 
18 #define SYS_EVENT_QUEUE_PRIO 0x02
19 
20 #define SYS_EVENT_QUEUE_PRIO_INHERIT 0x03
21 
23 #define SYS_EVENT_PORT_LOCAL 0x01
24 
26 #define SYS_EVENT_PORT_NO_NAME 0x00
27 
29 #define SYS_EVENT_QUEUE_KEY_LOCAL 0x00
30 
31 #ifdef __cplusplus
32  extern "C" {
33 #endif
34 
36 typedef struct sys_event_queue_attr
37 {
46 
53  s32 type;
54 
56  char name[8];
58 
60 typedef struct sys_event
61 {
62  u64 source;
63  u64 data_1;
64  u64 data_2;
65  u64 data_3;
66 } sys_event_t;
67 
75 LV2_SYSCALL sysEventQueueCreate(sys_event_queue_t *eventQ,sys_event_queue_attr_t *attrib,sys_ipc_key_t key,s32 size)
76 {
77  lv2syscall4(128,(u64)eventQ,(u64)attrib,key,size);
78  return_to_user_prog(s32);
79 }
80 
86 LV2_SYSCALL sysEventQueueDestroy(sys_event_queue_t eventQ,s32 mode)
87 {
88  lv2syscall2(129,eventQ,mode);
89  return_to_user_prog(s32);
90 }
91 
102 LV2_SYSCALL sysEventQueueReceive(sys_event_queue_t eventQ,sys_event_t *event,u64 timeout_usec)
103 {
104  lv2syscall3(130,eventQ,(u64)event,timeout_usec);
105 #ifdef REG_PASS_SYS_EVENT_QUEUE_RECEIVE
106  REG_PASS_SYS_EVENT_QUEUE_RECEIVE;
107 #endif
108  return_to_user_prog(s32);
109 }
110 
117 LV2_SYSCALL sysEventQueueDrain(sys_event_queue_t eventQ)
118 {
119  lv2syscall1(133,eventQ);
120  return_to_user_prog(s32);
121 }
122 
133 LV2_SYSCALL sysEventPortCreate(sys_event_port_t *portId,int portType,u64 name)
134 {
135  lv2syscall3(134,(u64)portId,portType,name);
136  return_to_user_prog(s32);
137 }
138 
143 LV2_SYSCALL sysEventPortDestroy(sys_event_port_t portId)
144 {
145  lv2syscall1(135,portId);
146  return_to_user_prog(s32);
147 }
148 
158 LV2_SYSCALL sysEventPortSend(sys_event_port_t portId,u64 data0,u64 data1,u64 data2)
159 {
160  lv2syscall4(138,portId,data0,data1,data2);
161  return_to_user_prog(s32);
162 }
163 
169 LV2_SYSCALL sysEventPortConnectLocal(sys_event_port_t portId,sys_event_queue_t eventQ)
170 {
171  lv2syscall2(136,portId,eventQ);
172  return_to_user_prog(s32);
173 }
174 
179 LV2_SYSCALL sysEventPortDisconnect(sys_event_port_t portId)
180 {
181  lv2syscall1(137,portId);
182  return_to_user_prog(s32);
183 }
184 
185 #ifdef __cplusplus
186  }
187 #endif
188 
189 #endif
u64 source
id of emitting source
Definition: event_queue.h:62
LV2_SYSCALL sysEventPortSend(sys_event_port_t portId, u64 data0, u64 data1, u64 data2)
Send an event.
Definition: event_queue.h:158
s32 type
Event queue type.
Definition: event_queue.h:53
struct sys_event sys_event_t
Data structure for received event data.
u64 data_3
data field 3
Definition: event_queue.h:65
u32 attr_protocol
Synchronization attribute.
Definition: event_queue.h:45
u64 data_2
data field 2
Definition: event_queue.h:64
LV2_SYSCALL sysEventQueueReceive(sys_event_queue_t eventQ, sys_event_t *event, u64 timeout_usec)
Receive an event from an event queue.
Definition: event_queue.h:102
LV2_SYSCALL sysEventPortDestroy(sys_event_port_t portId)
Destroys an event port.
Definition: event_queue.h:143
LV2_SYSCALL sysEventQueueDrain(sys_event_queue_t eventQ)
Drain an event queue.
Definition: event_queue.h:117
LV2_SYSCALL sysEventPortCreate(sys_event_port_t *portId, int portType, u64 name)
Create an event port.
Definition: event_queue.h:133
LV2_SYSCALL sysEventQueueDestroy(sys_event_queue_t eventQ, s32 mode)
Destroy an event queue.
Definition: event_queue.h:86
u64 data_1
data field 1
Definition: event_queue.h:63
LV2_SYSCALL sysEventQueueCreate(sys_event_queue_t *eventQ, sys_event_queue_attr_t *attrib, sys_ipc_key_t key, s32 size)
Create an event queue.
Definition: event_queue.h:75
LV2_SYSCALL sysEventPortConnectLocal(sys_event_port_t portId, sys_event_queue_t eventQ)
Connect an event port to an event queue in the same process.
Definition: event_queue.h:169
struct sys_event_queue_attr sys_event_queue_attr_t
Data structure for create attributes for an event queue.
Data structure for create attributes for an event queue.
Definition: event_queue.h:36
char name[8]
Name identifier.
Definition: event_queue.h:56
Data structure for received event data.
Definition: event_queue.h:60
LV2_SYSCALL sysEventPortDisconnect(sys_event_port_t portId)
Disconnect an event port from an event queue.
Definition: event_queue.h:179