8#ifndef __SPURS_SUPPORT_INTERFACE_H
9#define __SPURS_SUPPORT_INTERFACE_H
11#include <cell/spurs/queue.h>
12#include "spursUtilityMacros.h"
13#include "spursThreadSupportInterface.h"
18#include <sdk_version.h>
20#if CELL_SDK_VERSION < 0x081000
21#define CELL_SPURS_TASK_ERROR_AGAIN CELL_SPURS_EAGAIN
22#define CELL_SPURS_TASK_ERROR_BUSY CELL_SPURS_EBUSY
26#include <cell/spurs/task.h>
30#define CELL_SPURS_RESPONSE_QUEUE_SIZE 128
53 CELL_PPU_POINTER(CellSpursQueue) ppuResponseQueue;
60 CellSpursTaskArgument spursArgument;
68#include <cell/spurs/task.h>
70static inline void sendResponseToPPU(uint32_t ppuQueueEA, uint32_t uiArgument0,
71 uint32_t uiArgument1,
int iTag=1) {
73 __attribute__ ((aligned(16)));
75 response.uiArgument0=uiArgument0;
76 response.uiArgument1=uiArgument1;
80 iReturn=cellSpursQueueTryPushBegin(ppuQueueEA, &response, iTag);
81 }
while (iReturn == CELL_SPURS_TASK_ERROR_AGAIN ||
82 iReturn == CELL_SPURS_TASK_ERROR_BUSY);
84 SPU_ASSERT((iReturn == CELL_OK) &&
"Error writing to SPURS queue.");
86 cellSpursQueuePushEnd(ppuQueueEA, iTag);
90static inline void sendResponseToPPUAndExit(uint32_t ppuQueueEA, uint32_t uiArgument0,
91 uint32_t uiArgument1,
int iTag=1) {
93 __attribute__ ((aligned(16)));
95 response.uiArgument0=uiArgument0;
96 response.uiArgument1=uiArgument1;
100 iReturn=cellSpursQueueTryPushBegin(ppuQueueEA, &response, iTag);
101 }
while (iReturn == CELL_SPURS_TASK_ERROR_AGAIN ||
102 iReturn == CELL_SPURS_TASK_ERROR_BUSY);
104 SPU_ASSERT((iReturn == CELL_OK) &&
"Error writing to SPURS queue.");
106 cellSpursQueuePushEnd(ppuQueueEA, iTag);
115 SpursSupportInterface();
116 ~SpursSupportInterface();
117 int sendRequest(uint32_t uiCommand, uint32_t uiArgument0, uint32_t uiArgument1=0);
118 int waitForResponse(
unsigned int *puiArgument0,
unsigned int *puiArgument1);
124 void *m_spursTaskAddress;
125 CellSpursQueue m_responseQueue __attribute__((aligned(128)));
126 CellSPURSArgument m_aResponseBuffer[CELL_SPURS_RESPONSE_QUEUE_SIZE] __attribute__((aligned(16)));
128 bool m_bQueueInitialized;
Definition spursthreadsupportinterface.h:25
virtual int stopSPU()=0
tell the task scheduler we are done with the SPU tasks
virtual int waitForResponse(unsigned int *puiArgument0, unsigned int *puiArgument1)=0
check for messages from SPUs
virtual int sendRequest(uint32_t uiCommand, uint32_t uiArgument0, uint32_t uiArgument1)=0
send messages to SPUs
virtual int startSPU()=0
start the spus (can be called at the beginning of each frame, to make sure that the right SPU program...
Definition spursSupportInterface.h:50