106#define MFC_LSA 0x3004
107#define MFC_EAH 0x3008
108#define MFC_EAL 0x300C
109#define MFC_Size 0x3010
110#define MFC_Class_CMD 0x3014
111#define MFC_CMD_Status 0x3014
112#define MFC_QStatus 0x3104
113#define Prxy_QueryType 0x3204
114#define Prxy_QueryMask 0x321C
115#define Prxy_TagStatus 0x322C
116#define SPU_Out_MBox 0x4004
117#define SPU_In_MBox 0x400C
118#define SPU_MBox_Status 0x4014
119#define SPU_RunCtrl 0x401C
120#define SPU_Status 0x4024
121#define SPU_NextPC 0x4034
122#define SPU_Sig_Notify_1 0x1400C
123#define SPU_Sig_Notify_2 0x1C00C
125#define SPU_THREAD_GROUP_TYPE_NORMAL 0x0
126#define SPU_THREAD_GROUP_TYPE_SEQUENTIAL 0x1
127#define SPU_THREAD_GROUP_TYPE_SYSTEM 0x2
128#define SPU_THREAD_GROUP_TYPE_MEMORY_FROM_CONTAINER 0x4
130#define SPU_THREAD_GROUP_JOIN_GROUP_EXIT 0x0001
131#define SPU_THREAD_GROUP_JOIN_ALL_THREADS_EXIT 0x0002
132#define SPU_THREAD_GROUP_JOIN_TERMINATED 0x0004
134#define SPU_THREAD_GROUP_EVENT_RUN 0x1
135#define SPU_THREAD_GROUP_EVENT_RUN_KEY 0xFFFFFFFF53505500ULL
136#define SPU_THREAD_GROUP_EVENT_EXCEPTION 0x2
137#define SPU_THREAD_GROUP_EVENT_EXCEPTION_KEY 0xFFFFFFFF53505503ULL
140#define SPU_THREAD_ATTR_NONE 0x00
142#define SPU_THREAD_ATTR_ASYNC_INT_ENABLE 0x01
144#define SPU_THREAD_ATTR_DEC_SYNC_TB_ENABLE 0x02
147#define SPU_THREAD_EVENT_USER 0x01
149#define SPU_THREAD_EVENT_DMA 0x02
152#define SPU_THREAD_EVENT_USER_KEY 0xFFFFFFFF53505501ULL
154#define SPU_THREAD_EVENT_DMA_KEY 0xFFFFFFFF53505502ULL
157#define SPU_SIGNAL1_OVERWRITE 0x00
159#define SPU_SIGNAL1_OR 0x01
161#define SPU_SIGNAL2_OVERWRITE 0x00
163#define SPU_SIGNAL2_OR 0x02
166#define SPU_EXCEPTION_DMA_ALIGNMENT 0x0001U
167#define SPU_EXCEPTION_DMA_COMMAND 0x0002U
168#define SPU_EXCEPTION_SPU_ERROR 0x0004U
169#define SPU_EXCEPTION_MFC_FIR 0x0008U
170#define SPU_EXCEPTION_MFC_SEGMENT 0x0010U
171#define SPU_EXCEPTION_MFC_STORAGE 0x0020U
172#define SPU_EXCEPTION_STOP_CALL 0x0100U
173#define SPU_EXCEPTION_STOP_BREAK 0x0200U
174#define SPU_EXCEPTION_HALT 0x0400U
175#define SPU_EXCEPTION_UNKNOWN_SIGNAL 0x0800U
176#define SPU_EXCEPTION_NO_VALUE 0x0U
179#define SPU_THREAD_BASE 0xF0000000ULL
181#define SPU_THREAD_OFFSET 0x00100000ULL
183#define SPU_RAW_BASE 0xE0000000ULL
185#define SPU_RAW_OFFSET 0x00100000ULL
187#define SPU_LOCAL_OFFSET 0x00000000ULL
189#define SPU_PROBLEM_OFFSET 0x00040000ULL
194#define SPU_RAW_GET_BASE_OFFSET(spu) \
195 (SPU_RAW_BASE + (SPU_RAW_OFFSET*(spu)))
198#define SPU_RAW_GET_LOCAL_STORAGE(spu,reg) \
199 (SPU_RAW_GET_BASE_OFFSET(spu) + SPU_LOCAL_OFFSET + (reg))
202#define SPU_RAW_GET_PROBLEM_STORAGE(spu,reg) \
203 (SPU_RAW_GET_BASE_OFFSET(spu) + SPU_PROBLEM_OFFSET + (reg))
208#define SPU_THREAD_GET_BASE_OFFSET(spu) \
209 (SPU_THREAD_BASE + (SPU_THREAD_OFFSET*(spu)))
212#define SPU_THREAD_GET_LOCAL_STORAGE(spu,reg) \
213 (SPU_THREAD_GET_BASE_OFFSET(spu) + SPU_LOCAL_OFFSET + (reg))
216#define SPU_THREAD_GET_PROBLEM_STORAGE(spu,reg) \
217 (SPU_THREAD_GET_BASE_OFFSET(spu) + SPU_PROBLEM_OFFSET + (reg))
253 sys_mem_container_t
ct;
257#define sysSpuThreadAttributeInitialize(x) \
261 x.option = SPU_THREAD_ATTR_NONE; \
264#define sysSpuThreadAttributeName(x, s) \
271 for(; (n<127) && (s[n] != '\0'); n++) \
277#define sysSpuThreadAttributeOption(x, f) \
282#define sysSpuThreadArgumentInitialize(x) \
284 x.arg0 = x.arg1 = x.arg2 = x.arg3 = 0; \
287#define sysSpuThreadGroupAttributeInitialize(x) \
291 x.type = SPU_THREAD_GROUP_TYPE_NORMAL; \
294#define sysSpuThreadGroupAttributeName(x, s) \
301 for(; (n<127) && (s[n] != '\0'); n++) \
307#define sysSpuThreadGroupAttributeType(x, t) \
312#define sysSpuThreadGroupAttributeMemoryContainer(x, ct) \
314 x.type |= SPU_THREAD_GROUP_TYPE_MEMORY_FROM_CONTAINER; \
328 lv2syscall2(169,spus,rawspus);
329 return_to_user_prog(s32);
342 lv2syscall2(160,(u64)spu,(u64)attributes);
343 return_to_user_prog(s32);
354 lv2syscall1(161,spu);
355 return_to_user_prog(s32);
372 lv2syscall4(150,spu,classid,hardwarethread,(u64)tag);
373 return_to_user_prog(s32);
388 lv2syscall3(151,spu,classid,mask);
389 return_to_user_prog(s32);
404 lv2syscall3(152,spu,classid,(u64)mask);
405 return_to_user_prog(s32);
420 lv2syscall3(153, spu, classid, stat);
421 return_to_user_prog(s32);
436 lv2syscall3(154, spu, classid, (u64)stat);
437 return_to_user_prog(s32);
450 lv2syscall2(163, spu, (u64)
value);
451 return_to_user_prog(s32);
468 lv2syscall2(196, spu,
value);
469 return_to_user_prog(s32);
487 lv2syscall2(197, spu, (u64)
value);
488 return_to_user_prog(s32);
499 lv2syscall1(199, spu);
500 return_to_user_prog(s32);
513 lv2syscall2(156, (u64)image, (u64)path);
514 return_to_user_prog(s32);
529 lv2syscall3(260, (u64)image, fd, offset);
530 return_to_user_prog(s32);
551 lv2syscall6(172, (u64)thread, group, spu, (u64)image, (u64)attributes, (u64)arguments);
552 return_to_user_prog(s32);
565 lv2syscall2(166, thread, (u64)arguments);
566 return_to_user_prog(s32);
581 lv2syscall2(165, thread, (u64)status);
582 return_to_user_prog(s32);
602 lv2syscall4(191, thread, queue, type, spup);
603 return_to_user_prog(s32);
621 lv2syscall3(192, thread, type, spup);
622 return_to_user_prog(s32);
637 lv2syscall3(193, thread, queue, spuq_num);
638 return_to_user_prog(s32);
651 lv2syscall2(194, thread, spuq_num);
652 return_to_user_prog(s32);
670 lv2syscall4(181, thread, address,
value, type);
671 return_to_user_prog(s32);
689 lv2syscall4(182, thread, address, (u64)
value, type);
690 return_to_user_prog(s32);
707 lv2syscall3(184,thread,signal,
value);
708 return_to_user_prog(s32);
726 lv2syscall2(187, thread,
value);
727 return_to_user_prog(s32);
746 lv2syscall2(188, thread, (u64)
value);
747 return_to_user_prog(s32);
761 lv2syscall2(190, thread,
value);
762 return_to_user_prog(s32);
774 lv2syscall1(198, thread);
775 return_to_user_prog(s32);
793 lv2syscall4(170,(u64)group,num,prio,(u64)attr);
794 return_to_user_prog(s32);
806 lv2syscall1(171,group);
807 return_to_user_prog(s32);
819 lv2syscall1(173,group);
820 return_to_user_prog(s32);
832 lv2syscall1(174,group);
833 return_to_user_prog(s32);
845 lv2syscall1(175,group);
846 return_to_user_prog(s32);
858 lv2syscall1(176,group);
859 return_to_user_prog(s32);
871 lv2syscall2(177,group,
value);
872 return_to_user_prog(s32);
888 lv2syscall3(178,group,(u64)cause,(u64)status);
889 return_to_user_prog(s32);
903 lv2syscall2(179,group,prio);
904 return_to_user_prog(s32);
918 lv2syscall2(180,group,(u64)prio);
919 return_to_user_prog(s32);
924 lv2syscall3(185,group,eventQ,eventType);
925 return_to_user_prog(s32);
930 lv2syscall2(186,group,eventType);
931 return_to_user_prog(s32);
936 lv2syscall4(251,group,eventQ,req,(u64)spup);
937 return_to_user_prog(s32);
942 lv2syscall2(252,group,spup);
943 return_to_user_prog(s32);
SPU image data structure.
A structure containing the arguments passed to the SPU main function.
A structure containing SPU thread attributes.
const char *name ATTRIBUTE_PRXPTR
Effective address of the thread's name string.
u32 option
OR'ed list of SPU thread attribute flags (or SPU_THREAD_ATTR_NONE)
u32 nsize
Size of the name string in bytes (including terminating null byte).
A structure containing SPU thread group attributes.
union _sys_spu_thread_group_attr::@0 option
u32 nsize
Size of the name string in bytes (including terminating null byte).
const char *name ATTRIBUTE_PRXPTR
Effective address of the thread group's name string.
u32 type
Thread group type (0 for normal thread groups).
sys_mem_container_t ct
Memory container id (0 for normal thread groups).
LV2_SYSCALL sysSpuThreadWriteMb(sys_spu_thread_t thread, u32 value)
Write to the SPU thread's inbound mailbox register.
LV2_SYSCALL sysSpuThreadGroupJoin(sys_spu_group_t group, u32 *cause, u32 *status)
Wait for a SPU thread group to finish its execution.
LV2_SYSCALL sysSpuThreadGroupConnectEvent(sys_spu_group_t group, sys_event_queue_t eventQ, u32 eventType)
LV2_SYSCALL sysSpuThreadGroupCreate(sys_spu_group_t *group, u32 num, u32 prio, sysSpuThreadGroupAttribute *attr)
Create a SPU thread group.
struct _sys_spu_thread_arg sysSpuThreadArgument
A structure containing the arguments passed to the SPU main function.
LV2_SYSCALL sysSpuThreadBindQueue(sys_spu_thread_t thread, sys_event_queue_t queue, u32 spuq_num)
Bind an event queue to a SPU thread.
LV2_SYSCALL sysSpuThreadGroupTerminate(sys_spu_group_t group, u32 value)
Terminate a SPU thread group.
LV2_SYSCALL sysSpuRawSetIntStat(sys_raw_spu_t spu, u32 classid, u64 stat)
Set the value of the interrupt status register for a raw SPU.
LV2_SYSCALL sysSpuThreadGroupYield(sys_spu_group_t group)
Yield a SPU thread group.
LV2_SYSCALL sysSpuThreadGroupSetPriority(sys_spu_group_t group, u32 prio)
Set a SPU thread group's priority.
LV2_SYSCALL sysSpuThreadSetArguments(sys_spu_thread_t thread, sysSpuThreadArgument *arguments)
Set the SPU thread arguments.
static u32 sysSpuRawReadLocalStorage(sys_raw_spu_t spu, u32 reg)
LV2_SYSCALL sysSpuThreadConnectEvent(sys_spu_thread_t thread, sys_event_queue_t queue, u32 type, u8 spup)
Connect an event queue to a SPU thread.
LV2_SYSCALL sysSpuThreadGroupSuspend(sys_spu_group_t group)
Suspend a SPU thread group.
LV2_SYSCALL sysSpuThreadReadLocalStorage(sys_spu_thread_t thread, u32 address, u64 *value, u32 type)
Read a value From the SPU thread's local store memory.
LV2_SYSCALL sysSpuThreadGroupGetPriority(sys_spu_group_t group, u32 *prio)
Get a SPU thread group's priority.
LV2_SYSCALL sysSpuRawGetIntStat(sys_raw_spu_t spu, u32 classid, u64 *stat)
Get the value of the interrupt status register for a raw SPU.
LV2_SYSCALL sysSpuRawRecoverPageFault(sys_raw_spu_t spu)
Recover a raw SPU from a page fault.
LV2_SYSCALL sysSpuThreadGetConfiguration(sys_spu_thread_t thread, u64 *value)
Get the configuration of the SPU thread's signal notification.
LV2_SYSCALL sysSpuThreadGroupStart(sys_spu_group_t group)
Start a SPU thread group.
static void sysSpuRawWriteProblemStorage(sys_raw_spu_t spu, u32 reg, u32 value)
LV2_SYSCALL sysSpuThreadWriteLocalStorage(sys_spu_thread_t thread, u32 address, u64 value, u32 type)
Write a value to a SPU thread's local store memory.
LV2_SYSCALL sysSpuThreadGroupDisonnectEventAllThreads(sys_spu_group_t group, u8 spup)
LV2_SYSCALL sysSpuRawCreateInterrupTag(sys_raw_spu_t spu, u32 classid, u32 hardwarethread, u32 *tag)
Create an interrupt tag for a raw SPU.
LV2_SYSCALL sysSpuThreadRecoverPageFault(sys_spu_thread_t thread)
Recover from a SPU thread page fault.
struct _sys_spu_thread_attr sysSpuThreadAttribute
A structure containing SPU thread attributes.
LV2_SYSCALL sysSpuThreadDisconnectEvent(sys_spu_thread_t thread, u32 type, u8 spup)
Disconnect an event queue from a SPU thread.
LV2_SYSCALL sysSpuImageOpen(sysSpuImage *image, const char *path)
Create a SPU image from an ELF file.
LV2_SYSCALL sysSpuRawGetIntMask(sys_raw_spu_t spu, u32 classid, u64 *mask)
Get the value of the interrupt mask register for a raw SPU.
#define SPU_RAW_GET_LOCAL_STORAGE(spu, reg)
Returns the memory-mapped address of local storage of a raw SPU.
LV2_SYSCALL sysSpuThreadGroupConnectEventAllThreads(sys_spu_group_t group, sys_event_queue_t eventQ, u64 req, u8 *spup)
static void sysSpuThreadWriteProblemStorage(sys_raw_spu_t spu, u32 reg, u32 value)
LV2_SYSCALL sysSpuImageOpenFd(sysSpuImage *image, s32 fd, u64 offset)
Create a SPU image from an open binary file.
LV2_SYSCALL sysSpuRawSetIntMask(sys_raw_spu_t spu, u32 classid, u64 mask)
Set the value of the interrupt mask register for a raw SPU.
LV2_SYSCALL sysSpuRawGetConfirugation(sys_raw_spu_t spu, u32 *value)
Get the configuration of the raw SPU's signal notification.
LV2_SYSCALL sysSpuThreadGroupResume(sys_spu_group_t group)
Resume a SPU thread group.
LV2_SYSCALL sysSpuThreadInitialize(sys_spu_thread_t *thread, sys_spu_group_t group, u32 spu, sysSpuImage *image, sysSpuThreadAttribute *attributes, sysSpuThreadArgument *arguments)
Initialize a SPU thread.
static void sysSpuRawWriteLocalStorage(sys_raw_spu_t spu, u32 reg, u32 value)
LV2_SYSCALL sysSpuRawCreate(sys_raw_spu_t *spu, u32 *attributes)
Allocate a raw SPU.
LV2_SYSCALL sysSpuThreadSetConfiguration(sys_spu_thread_t thread, u64 value)
Configure the SPU thread's signal notification.
#define SPU_THREAD_GET_PROBLEM_STORAGE(spu, reg)
Returns the memory-mapped address of problem storage of a SPU thread.
LV2_SYSCALL sysSpuRawDestroy(sys_raw_spu_t spu)
De-allocate a raw SPU.
static u32 sysSpuThreadReadProblemStorage(sys_raw_spu_t spu, u32 reg)
LV2_SYSCALL sysSpuThreadGetExitStatus(sys_spu_thread_t thread, s32 *status)
Get the exit status of a thread.
LV2_SYSCALL sysSpuInitialize(u32 spus, u32 rawspus)
Initialize the SPU management.
struct _sys_spu_thread_group_attr sysSpuThreadGroupAttribute
A structure containing SPU thread group attributes.
LV2_SYSCALL sysSpuThreadGroupDestroy(sys_spu_group_t group)
Destroy a SPU thread group.
#define SPU_RAW_GET_PROBLEM_STORAGE(spu, reg)
Returns the memory-mapped address of problem storage of a raw SPU.
LV2_SYSCALL sysSpuThreadGroupDisconnectEvent(sys_spu_group_t group, u32 eventType)
LV2_SYSCALL sysSpuThreadWriteSignal(sys_spu_thread_t thread, u32 signal, u32 value)
Write to the SPU thread's signal notification register.
LV2_SYSCALL sysSpuThreadUnbindQueue(sys_spu_thread_t thread, u32 spuq_num)
Unbind an event queue from a SPU thread.
LV2_SYSCALL sysSpuRawReadPuintMb(sys_raw_spu_t spu, u32 *value)
Read from the raw SPU's outbound interrupt mailbox register.
LV2_SYSCALL sysSpuRawSetConfiguration(sys_raw_spu_t spu, u32 value)
Configure the raw SPU's signal notification.
static u32 sysSpuRawReadProblemStorage(sys_raw_spu_t spu, u32 reg)