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

SPU management library. More...

#include <ppu-types.h>

Go to the source code of this file.

Data Structures

struct  _sys_spu_segment
 SPU segment data structure. More...
 
struct  _sys_spu_image
 SPU image data structure. More...
 

Macros

#define SPU_SEGMENT_TYPE_COPY   0x01
 Copy segment type.
 
#define SPU_SEGMENT_TYPE_FILL   0x02
 Fill segment type.
 
#define SPU_SEGMENT_TYPE_INFO   0x04
 Info segment type.
 
#define SPU_IMAGE_TYPE_USER   0x00
 
#define SPU_IMAGE_TYPE_KERNEL   0x00
 
#define SPU_IMAGE_PROTECT   0x00
 
#define SPU_IMAGE_DIRECT   0x01
 

Typedefs

typedef struct _sys_spu_segment sysSpuSegment
 SPU segment data structure.
 
typedef struct _sys_spu_image sysSpuImage
 SPU image data structure.
 

Functions

s32 sysSpuElfGetInformation (const void *elf, u32 *entryPoint, u32 *segmentCount)
 
s32 sysSpuElfGetSegments (const void *elf, sysSpuSegment *segments, u32 segmentCount)
 
s32 sysSpuRawLoad (sys_raw_spu_t spu, const char *path, u32 *entryPoint)
 Load a SPU program file into a raw SPU's local store. More...
 
s32 sysSpuRawImageLoad (sys_raw_spu_t spu, sysSpuImage *image)
 Load a SPU image into a raw SPU's local store. More...
 
s32 sysSpuImageClose (sysSpuImage *image)
 Close an opened SPU image file. More...
 
s32 sysSpuImageImport (sysSpuImage *image, const void *elf, u32 type)
 Import a SPU image from an ELF file in memory. More...
 
s32 sysSpuPrintfInitialize (int prio, void(*entry)(void *))
 Initialize Spu printf service on ppu. More...
 
s32 sysSpuPrintfAttachGroup (sys_spu_group_t group)
 Enable Spu printf service from each of the SPU thread in the specified SPU thread group. More...
 
s32 sysSpuPrintfDetachGroup (sys_spu_group_t group)
 Disable Spu printf service from each of the SPU thread in the specified SPU thread group. More...
 
s32 sysSpuPrintfAttachThread (sys_spu_thread_t thread)
 Enable Spu printf service in the specified SPU thread. More...
 
s32 sysSpuPrintfDetach_Tread (sys_spu_thread_t thread)
 Disable Spu printf service in the specified SPU thread. More...
 
s32 sysSpuPrintfFinalize ()
 Terminate Spu printf service. More...
 

Detailed Description

SPU management library.

These are the system library calls for SPU management.

See also
Quick guide to SPU management

Function Documentation

◆ sysSpuImageClose()

s32 sysSpuImageClose ( sysSpuImage image)

Close an opened SPU image file.

Parameters
imagePointer to the SPU image structure.
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuImageImport()

s32 sysSpuImageImport ( sysSpuImage image,
const void *  elf,
u32  type 
)

Import a SPU image from an ELF file in memory.

Parameters
imagePointer to the updated image structure.
elfPointer to the ELF data in memory.
typeType of the image file. Generally set to 0.
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuPrintfAttachGroup()

s32 sysSpuPrintfAttachGroup ( sys_spu_group_t  group)

Enable Spu printf service from each of the SPU thread in the specified SPU thread group.

Parameters
groupSPU thread group ID to be attached
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuPrintfAttachThread()

s32 sysSpuPrintfAttachThread ( sys_spu_thread_t  thread)

Enable Spu printf service in the specified SPU thread.

Parameters
groupSPU thread ID to be attached
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuPrintfDetach_Tread()

s32 sysSpuPrintfDetach_Tread ( sys_spu_thread_t  thread)

Disable Spu printf service in the specified SPU thread.

Parameters
threadSPU thread ID to be detatached
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuPrintfDetachGroup()

s32 sysSpuPrintfDetachGroup ( sys_spu_group_t  group)

Disable Spu printf service from each of the SPU thread in the specified SPU thread group.

Parameters
groupSPU thread group ID to be detached
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuPrintfFinalize()

s32 sysSpuPrintfFinalize ( )

Terminate Spu printf service.

Parameters
none
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuPrintfInitialize()

s32 sysSpuPrintfInitialize ( int  prio,
void(*)(void *)  entry 
)

Initialize Spu printf service on ppu.

Parameters
prioPriority of server
entryPointer to funtion callback on ppu side
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuRawImageLoad()

s32 sysSpuRawImageLoad ( sys_raw_spu_t  spu,
sysSpuImage image 
)

Load a SPU image into a raw SPU's local store.

Parameters
spuThe raw SPU identifier.
imagePointer to the SPU image structure.
Returns
zero if no error occured, nonzero otherwise.

◆ sysSpuRawLoad()

s32 sysSpuRawLoad ( sys_raw_spu_t  spu,
const char *  path,
u32 *  entryPoint 
)

Load a SPU program file into a raw SPU's local store.

Parameters
spuThe raw SPU identifier.
pathThe SPU program file name.
entryPointPointer to the returned entry point address.
Returns
zero if no error occured, nonzero otherwise.