psl1ght
A free SDK for Sony's PS3 console
spu.h
Go to the documentation of this file.
1 
9 #ifndef __LV2_SPU_H__
10 #define __LV2_SPU_H__
11 
12 #include <ppu-types.h>
13 
15 #define SPU_SEGMENT_TYPE_COPY 0x01
16 
17 #define SPU_SEGMENT_TYPE_FILL 0x02
18 
19 #define SPU_SEGMENT_TYPE_INFO 0x04
20 
21 #define SPU_IMAGE_TYPE_USER 0x00
22 #define SPU_IMAGE_TYPE_KERNEL 0x00
23 
24 #define SPU_IMAGE_PROTECT 0x00
25 #define SPU_IMAGE_DIRECT 0x01
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
32 typedef struct _sys_spu_segment
33 {
41  u32 type;
42  u32 lsStart;
43  u32 size;
44  union {
48  u32 paStart;
50  u32 value;
51  };
53 
55 typedef struct _sys_spu_image
56 {
57  u32 type;
58  u32 entryPoint;
59  u32 segments;
61 } sysSpuImage;
62 
63 
64 s32 sysSpuElfGetInformation(const void *elf,u32 *entryPoint,u32 *segmentCount);
65 s32 sysSpuElfGetSegments(const void *elf,sysSpuSegment *segments,u32 segmentCount);
66 
77 s32 sysSpuRawLoad(sys_raw_spu_t spu,const char *path,u32 *entryPoint);
78 
87 s32 sysSpuRawImageLoad(sys_raw_spu_t spu,sysSpuImage *image);
88 
95 s32 sysSpuImageClose(sysSpuImage *image);
96 
107 s32 sysSpuImageImport(sysSpuImage *image,const void *elf,u32 type);
116 s32 sysSpuPrintfInitialize(int prio, void (*entry)(void*));
117 
124 s32 sysSpuPrintfAttachGroup(sys_spu_group_t group);
125 
132 s32 sysSpuPrintfDetachGroup(sys_spu_group_t group);
133 
140 s32 sysSpuPrintfAttachThread(sys_spu_thread_t thread);
141 
148 s32 sysSpuPrintfDetach_Tread(sys_spu_thread_t thread);
149 
156 
157 #ifdef __cplusplus
158  }
159 #endif
160 
161 #endif
u32 paStart
start address in main memory to be copied if type is SPU_SEGMENT_TYPE_COPY
Definition: spu.h:48
u32 segments
address of segments
Definition: spu.h:59
u32 type
Definition: spu.h:41
struct _sys_spu_segment sysSpuSegment
SPU segment data structure.
SPU segment data structure.
Definition: spu.h:32
s32 sysSpuRawImageLoad(sys_raw_spu_t spu, sysSpuImage *image)
Load a SPU image into a raw SPU's local store.
u32 entryPoint
entry point
Definition: spu.h:58
u32 segmentCount
number of segments
Definition: spu.h:60
s32 sysSpuPrintfAttachThread(sys_spu_thread_t thread)
Enable Spu printf service in the specified SPU thread.
u32 type
type
Definition: spu.h:57
u32 size
Definition: spu.h:43
s32 sysSpuPrintfFinalize()
Terminate Spu printf service.
s32 sysSpuPrintfDetach_Tread(sys_spu_thread_t thread)
Disable Spu printf service in the specified SPU thread.
s32 sysSpuPrintfAttachGroup(sys_spu_group_t group)
Enable Spu printf service from each of the SPU thread in the specified SPU thread group.
u32 value
fill value if type is SPU_SEGMENT_TYPE_FILL
Definition: spu.h:50
s32 sysSpuImageClose(sysSpuImage *image)
Close an opened SPU image file.
SPU image data structure.
Definition: spu.h:55
s32 sysSpuPrintfInitialize(int prio, void(*entry)(void *))
Initialize Spu printf service on ppu.
s32 sysSpuImageImport(sysSpuImage *image, const void *elf, u32 type)
Import a SPU image from an ELF file in memory.
u32 lsStart
start address in local store
Definition: spu.h:42
s32 sysSpuPrintfDetachGroup(sys_spu_group_t group)
Disable Spu printf service from each of the SPU thread in the specified SPU thread group.
s32 sysSpuRawLoad(sys_raw_spu_t spu, const char *path, u32 *entryPoint)
Load a SPU program file into a raw SPU's local store.
struct _sys_spu_image sysSpuImage
SPU image data structure.