17 #ifndef BT_SPU_LIBSPE2_SUPPORT_H
18 #define BT_SPU_LIBSPE2_SUPPORT_H
34 Spu_Mailbox_Event_Nothing = 0,
35 Spu_Mailbox_Event_Task = 1,
36 Spu_Mailbox_Event_Shutdown = 2,
38 Spu_Mailbox_Event_ForceDword = 0xFFFFFFFF
45 Spu_Status_Occupied = 1,
46 Spu_Status_Startup = 2,
48 Spu_Status_ForceDword = 0xFFFFFFFF
80 typedef struct ppu_pthread_data
82 spe_context_ptr_t context;
88 spe_stop_info_t stopinfo;
92 static void *ppu_pthread_function(
void *arg)
94 ppu_pthread_data_t * datap = (ppu_pthread_data_t *)arg;
99 spe_context_run(datap->context, &datap->entry, datap->flags, datap->argp.p, datap->envp.p, &datap->stopinfo);
100 if (datap->stopinfo.stop_reason == SPE_EXIT)
102 if (datap->stopinfo.result.spe_exit_code != 0)
104 perror(
"FAILED: SPE returned a non-zero exit status: \n");
110 perror(
"FAILED: SPE abnormally terminated\n");
132 SpuLibspe2Support(spe_program_handle_t *speprog,
int numThreads);
135 spe_program_handle_t *program;
138 ppu_pthread_data_t data[MAX_SPUS];
141 ~SpuLibspe2Support();
147 void waitForResponse(
unsigned int *puiArgument0,
unsigned int *puiArgument1);
163 void internal_startSPU();
172 #endif // NOT __SPU__
176 #endif //BT_SPU_LIBSPE2_SUPPORT_H
virtual void setNumTasks(int numTasks)=0
tell the task scheduler to use no more than numTasks tasks
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
virtual void sendRequest(uint32_t uiCommand, ppu_address_t uiArgument0, uint32_t uiArgument1)=0
send messages to SPUs
virtual void startSPU()=0
non-blocking test if a task is completed.
virtual void stopSPU()=0
tell the task scheduler we are done with the SPU tasks
This file provides some platform/compiler checks for common definitions.
virtual void waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)=0
check for messages from SPUs