16 #ifndef BT_SPU_SAMPLE_TASK_PROCESS_H
17 #define BT_SPU_SAMPLE_TASK_PROCESS_H
33 #define CMD_SAMPLE_TASK_COMMAND 10
69 void issueTask(
void* sampleMainMemPtr,
int sampleValue,
int sampleCommand);
76 #if defined(USE_LIBSPE2) && defined(__SPU__)
77 #include "../SpuLibspe2Support.h"
79 #include <spu_intrinsics.h>
80 #include <spu_mfcio.h>
83 void * SamplelsMemoryFunc();
84 void SampleThreadFunc(
void* userPtr,
void* lsMemory);
88 int main(
unsigned long long speid,
addr64 argp,
addr64 envp)
90 printf(
"SPU is up \n");
94 unsigned int received_message = Spu_Mailbox_Event_Nothing;
95 bool shutdown =
false;
100 status.m_status = Spu_Status_Free;
101 status.m_lsMemory.p = SamplelsMemoryFunc();
109 received_message = spu_read_in_mbox();
113 switch(received_message)
115 case Spu_Mailbox_Event_Shutdown:
118 case Spu_Mailbox_Event_Task:
120 #ifdef DEBUG_LIBSPE2_MAINLOOP
121 printf(
"SPU recieved Task \n");
122 #endif //DEBUG_LIBSPE2_MAINLOOP
126 btAssert(status.m_status==Spu_Status_Occupied);
131 SampleThreadFunc((
void*)&taskDesc, reinterpret_cast<void*> (taskDesc.m_mainMemoryPtr) );
133 case Spu_Mailbox_Event_Nothing:
139 status.m_status = Spu_Status_Free;
152 #endif // BT_SPU_SAMPLE_TASK_PROCESS_H
SpuSampleTaskProcess(btThreadSupportInterface *threadInterface, int maxNumOutstandingTasks)
int m_maxNumOutstandingTasks
int cellDmaGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
#define ATTRIBUTE_ALIGNED128(a)
void postProcess(int taskId, int outputSize)
Optional PPU-size post processing for each task.
void issueTask(void *sampleMainMemPtr, int sampleValue, int sampleCommand)
btAlignedObjectArray< bool > m_taskBusy
int cellDmaLargePut(const void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
cellDmaLargePut Win32 replacements for Cell DMA to allow simulating most of the SPU code (just memcpy...
void initialize()
call initialize in the beginning of the frame, before addCollisionPairToTask
void cellDmaWaitTagStatusAll(int ignore)
cellDmaWaitTagStatusAll Win32 replacements for Cell DMA to allow simulating most of the SPU code (jus...
void flush()
call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished...
SpuSampleTaskProcess handles SPU processing of collision pairs.
class btThreadSupportInterface * m_threadInterface
#define ATTRIBUTE_ALIGNED16(a)
This file provides some platform/compiler checks for common definitions.
btAlignedObjectArray< SpuSampleTaskDesc > m_spuSampleTaskDesc