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