psl1ght
A free SDK for Sony's PS3 console
Data Structures | Macros | Typedefs | Functions
event_queue.h File Reference

Event queue management functions. More...

#include <ppu-lv2.h>

Go to the source code of this file.

Data Structures

struct  sys_event_queue_attr
 Data structure for create attributes for an event queue. More...
 
struct  sys_event
 Data structure for received event data. More...
 

Macros

#define SYS_EVENT_QUEUE_PPU   0x01
 Event queue type PPU.
 
#define SYS_EVENT_QUEUE_SPU   0x02
 Event queue type SPU.
 
#define SYS_EVENT_QUEUE_FIFO   0x01
 Synchronize event queue FIFO.
 
#define SYS_EVENT_QUEUE_PRIO   0x02
 Synchronize event queue PRIO.
 
#define SYS_EVENT_QUEUE_PRIO_INHERIT   0x03
 Synchronize event queue PRIO_INHERIT.
 
#define SYS_EVENT_PORT_LOCAL   0x01
 Event port type LOCAL.
 
#define SYS_EVENT_PORT_NO_NAME   0x00
 Used to auto create a port name.
 
#define SYS_EVENT_QUEUE_KEY_LOCAL   0x00
 Used to auto create a event queue key.
 

Typedefs

typedef struct sys_event_queue_attr sys_event_queue_attr_t
 Data structure for create attributes for an event queue.
 
typedef struct sys_event sys_event_t
 Data structure for received event data.
 

Functions

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. More...
 
LV2_SYSCALL sysEventQueueDestroy (sys_event_queue_t eventQ, s32 mode)
 Destroy an event queue. More...
 
LV2_SYSCALL sysEventQueueReceive (sys_event_queue_t eventQ, sys_event_t *event, u64 timeout_usec)
 Receive an event from an event queue. More...
 
LV2_SYSCALL sysEventQueueDrain (sys_event_queue_t eventQ)
 Drain an event queue. More...
 
LV2_SYSCALL sysEventPortCreate (sys_event_port_t *portId, int portType, u64 name)
 Create an event port. More...
 
LV2_SYSCALL sysEventPortDestroy (sys_event_port_t portId)
 Destroys an event port. More...
 
LV2_SYSCALL sysEventPortSend (sys_event_port_t portId, u64 data0, u64 data1, u64 data2)
 Send an event. More...
 
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. More...
 
LV2_SYSCALL sysEventPortDisconnect (sys_event_port_t portId)
 Disconnect an event port from an event queue. More...
 

Detailed Description

Event queue management functions.

Function Documentation

◆ sysEventPortConnectLocal()

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.

Parameters
portIdThe event port id.
eventQThe event queue id.
Returns
zero if no error, nonzero otherwise.

◆ sysEventPortCreate()

LV2_SYSCALL sysEventPortCreate ( sys_event_port_t *  portId,
int  portType,
u64  name 
)

Create an event port.

This function creates an event port for sending events thru a connected event queue.

Parameters
portIdPointer to receive the event port id.
portTypeType of the port to create.
Possible values:
nameUser defined name or SYS_EVENT_PORT_NO_NAME.
Returns
zero if no error, nonzero otherwise.

◆ sysEventPortDestroy()

LV2_SYSCALL sysEventPortDestroy ( sys_event_port_t  portId)

Destroys an event port.

Parameters
portIdEvent port id of the event port to be destroyed.
Returns
zero if no error, nonzero otherwise.

◆ sysEventPortDisconnect()

LV2_SYSCALL sysEventPortDisconnect ( sys_event_port_t  portId)

Disconnect an event port from an event queue.

Parameters
portIdThe event port id.
Returns
zero if no error, nonzero otherwise.

◆ sysEventPortSend()

LV2_SYSCALL sysEventPortSend ( sys_event_port_t  portId,
u64  data0,
u64  data1,
u64  data2 
)

Send an event.

This function sends an event to the event queue that is connected with the specified event port. Three additional 64-bit data can be sent with the event.

Parameters
portIdEvent port id.
data0Additional data.
data1Additional data.
data2Additional data.
Returns
zero if no error, nonzero otherwise.

◆ sysEventQueueCreate()

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.

Parameters
eventQPointer to receive the event queue id.
attribPointer to attribute structure.
keyKey to be used with this event queue.
sizeInitial size of the event queue.
Returns
zero if no error, nonzero otherwise.

◆ sysEventQueueDestroy()

LV2_SYSCALL sysEventQueueDestroy ( sys_event_queue_t  eventQ,
s32  mode 
)

Destroy an event queue.

Parameters
eventQThe event queue id.
modeDestroy mode (0: normal).
Returns
zero if no error, nonzero otherwise.

◆ sysEventQueueDrain()

LV2_SYSCALL sysEventQueueDrain ( sys_event_queue_t  eventQ)

Drain an event queue.

This function removes all pending events in the queue, making it empty.

Parameters
eventQThe event queue id.
Returns
zero if no error, nonzero otherwise.

◆ sysEventQueueReceive()

LV2_SYSCALL sysEventQueueReceive ( sys_event_queue_t  eventQ,
sys_event_t event,
u64  timeout_usec 
)

Receive an event from an event queue.

The current thread blocks until an event is received or the timeout period (in microseconds) has been reached.

Parameters
eventQThe event queue id.
eventPointer to a structure for received event data.
timeout_usecTimeout period, or 0 for no timeout.
Returns
zero if an event was received, nonzero if the timeout delay was reached or if an error occured.