psl1ght
A free SDK for Sony's PS3 console
Macros | Functions
spu_event.h File Reference

SPU runtime library. More...

#include <stdint.h>
#include <sys/cdefs.h>

Go to the source code of this file.

Macros

#define EVENT_DATA0_MASK   0x00FFFFFF
 
#define EVENT_PORT_SHIFT   24
 
#define EVENT_PORT_MAX_NUM   63
 

Functions

int spu_thread_send_event (uint8_t spup, uint32_t data0, uint32_t data1)
 Send an SPU thread user event. More...
 
int spu_thread_throw_event (uint8_t spup, uint32_t data0, uint32_t data1)
 Send an SPU thread user event. More...
 
int spu_thread_receive_event (uint32_t spuq, uint32_t *data0, uint32_t *data1, uint32_t *data2)
 Receive an event from a bound SPU event queue. More...
 
int spu_thread_tryreceive_event (uint32_t spuq, uint32_t *data0, uint32_t *data1, uint32_t *data2)
 Receive an event from a bound SPU event queue if an event is present. More...
 

Detailed Description

SPU runtime library.

These are the SPU library calls for SPU events.

See also
Quick guide to SPU management

Function Documentation

◆ spu_thread_receive_event()

int spu_thread_receive_event ( uint32_t  spuq,
uint32_t *  data0,
uint32_t *  data1,
uint32_t *  data2 
)

Receive an event from a bound SPU event queue.

This is a blocking call. It waits for an event to be received.

Parameters
spuqEvent queue binding id (as provided to sysSpuThreadBindQueue).
data0Pointer to storage for the first event data field.
data1Pointer to storage for the second event data field.
data2Pointer to storage for the third event data field.
Returns
zero if no error occured, nonzero otherwise.

◆ spu_thread_send_event()

int spu_thread_send_event ( uint8_t  spup,
uint32_t  data0,
uint32_t  data1 
)

Send an SPU thread user event.

This function sends an SPU thread user event to an event queue (secure mode). The sent data will be received as sys_event_t structure type. The data will be stored as the following:

  • source = SPU_THREAD_EVENT_USER_KEY
  • data_1 = SPU thread ID
  • data_2 (upper 32 bits) = SPU port number
  • data_2 (lower 32 bits) = lower 24 bits of data0
  • data_3 = data1
    Parameters
    spupSPU port number.
    data0Data 0 (only lower 24 bits are sent)
    data1Data 1
    Returns
    zero if no error occured, nonzero otherwise.

◆ spu_thread_throw_event()

int spu_thread_throw_event ( uint8_t  spup,
uint32_t  data0,
uint32_t  data1 
)

Send an SPU thread user event.

This function sends an SPU thread user event to an event queue (fire and forget mode). The sent data will be received as sys_event_t structure type. The data will be stored as the following:

  • source = SPU_THREAD_EVENT_USER_KEY
  • data_1 = SPU thread ID
  • data_2 (upper 32 bits) = SPU port number
  • data_2 (lower 32 bits) = lower 24 bits of data0
  • data_3 = data1
    Parameters
    spupSPU port number.
    data0Data 0 (only lower 24 bits are sent)
    data1Data 1
    Returns
    zero if no error occured, nonzero otherwise.

◆ spu_thread_tryreceive_event()

int spu_thread_tryreceive_event ( uint32_t  spuq,
uint32_t *  data0,
uint32_t *  data1,
uint32_t *  data2 
)

Receive an event from a bound SPU event queue if an event is present.

This call is non blocking. It returns even if no event has been received.

Parameters
spuqEvent queue binding id (as provided to sysSpuThreadBindQueue).
data0Pointer to storage for the first event data field.
data1Pointer to storage for the second event data field.
data2Pointer to storage for the third event data field.
Returns
zero if an event was received, nonzero if no event was received or in case of error.