#pragma once #include "Emu/Cell/SPURSManager.h" // Core return codes. enum { CELL_SPURS_CORE_ERROR_AGAIN = 0x80410701, CELL_SPURS_CORE_ERROR_INVAL = 0x80410702, CELL_SPURS_CORE_ERROR_NOMEM = 0x80410704, CELL_SPURS_CORE_ERROR_SRCH = 0x80410705, CELL_SPURS_CORE_ERROR_PERM = 0x80410709, CELL_SPURS_CORE_ERROR_BUSY = 0x8041070A, CELL_SPURS_CORE_ERROR_STAT = 0x8041070F, CELL_SPURS_CORE_ERROR_ALIGN = 0x80410710, CELL_SPURS_CORE_ERROR_NULL_POINTER = 0x80410711, }; // Task return codes. enum { CELL_SPURS_TASK_ERROR_AGAIN = 0x80410901, CELL_SPURS_TASK_ERROR_INVAL = 0x80410902, CELL_SPURS_TASK_ERROR_NOMEM = 0x80410904, CELL_SPURS_TASK_ERROR_SRCH = 0x80410905, CELL_SPURS_TASK_ERROR_NOEXEC = 0x80410907, CELL_SPURS_TASK_ERROR_PERM = 0x80410909, CELL_SPURS_TASK_ERROR_BUSY = 0x8041090A, CELL_SPURS_TASK_ERROR_FAULT = 0x8041090D, CELL_SPURS_TASK_ERROR_STAT = 0x8041090F, CELL_SPURS_TASK_ERROR_ALIGN = 0x80410910, CELL_SPURS_TASK_ERROR_NULL_POINTER = 0x80410911, CELL_SPURS_TASK_ERROR_FATAL = 0x80410914, CELL_SPURS_TASK_ERROR_SHUTDOWN = 0x80410920, }; // Core CellSpurs structures. struct CellSpurs { SPURSManager *spurs; }; struct CellSpurs2 { SPURSManager *spurs; }; struct CellSpursAttribute { SPURSManagerAttribute *attr; }; struct CellSpursEventFlag { SPURSManagerEventFlag *eventFlag; }; struct CellSpursTaskset { SPURSManagerTaskset *taskset; }; struct CellSpursInfo { be_t nSpus; be_t spuThreadGroupPriority; be_t ppuThreadPriority; bool exitIfNoWork; bool spurs2; be_t traceBuffer_addr; //void *traceBuffer; be_t traceBufferSize; be_t traceMode; be_t spuThreadGroup; //typedef u32 sys_spu_thread_group_t; be_t spuThreads[8]; //typedef u32 sys_spu_thread_t; be_t spursHandlerThread0; be_t spursHandlerThread1; s8 namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1]; be_t namePrefixLength; be_t deadlineMissCounter; be_t deadlineMeetCounter; //u8 padding[]; }; struct CellSpursExceptionInfo { be_t spu_thread; be_t spu_npc; be_t cause; be_t option; }; struct CellSpursTraceInfo { be_t spu_thread[8]; be_t count[8]; be_t spu_thread_grp; be_t nspu; //u8 padding[]; }; struct CellTraceHeader { u8 tag; u8 length; u8 cpu; u8 thread; be_t time; }; struct CellSpursTracePacket { struct header_struct { u8 tag; u8 length; u8 spu; u8 workload; be_t time; } header; struct data_struct { struct load_struct { be_t ea; be_t ls; be_t size; } load; struct map_struct { be_t offset; be_t ls; be_t size; } map; struct start_struct { s8 module[4]; be_t level; be_t ls; } start; be_t user; be_t guid; } data; }; // Exception handlers. typedef void (*CellSpursGlobalExceptionEventHandler)(mem_ptr_t spurs, const mem_ptr_t info, u32 id, mem_ptr_t arg); typedef void (*CellSpursTasksetExceptionEventHandler)(mem_ptr_t spurs, mem_ptr_t taskset, u32 idTask, const mem_ptr_t info, mem_ptr_t arg); struct CellSpursTasksetInfo { //CellSpursTaskInfo taskInfo[CELL_SPURS_MAX_TASK]; be_t argument; be_t idWorkload; be_t idLastScheduledTask; //typedef unsigned CellSpursTaskId be_t name_addr; CellSpursTasksetExceptionEventHandler exceptionEventHandler; be_t exceptionEventHandlerArgument_addr; //void *exceptionEventHandlerArgument be_t sizeTaskset; //be_t reserved[]; }; struct CellSpursTaskset2 { be_t skip[10496]; }; struct CellSpursTasksetAttribute2 { be_t revision; be_t name_addr; be_t argTaskset; u8 priority[8]; be_t maxContention; be_t enableClearLs; be_t CellSpursTaskNameBuffer_addr; //??? *taskNameBuffer //be_t __reserved__[]; }; // cellSpurs task structures. struct CellSpursTaskNameBuffer { char taskName[CELL_SPURS_MAX_TASK][CELL_SPURS_MAX_TASK_NAME_LENGTH]; }; struct CellSpursTraceTaskData { be_t incident; be_t task; }; typedef be_t be_u32; typedef be_t be_u64; struct CellSpursTaskArgument { be_u32 u32[4]; be_u64 u64[2]; }; struct CellSpursTaskLsPattern { be_u32 u32[4]; be_u64 u64[2]; }; struct CellSpursTaskAttribute2 { be_t revision; be_t sizeContext; be_t eaContext; CellSpursTaskLsPattern lsPattern; //??? be_t name_addr; //be_t __reserved__[]; }; struct CellSpursTaskExitCode { unsigned char skip[128]; }; struct CellSpursTaskInfo { CellSpursTaskLsPattern lsPattern; CellSpursTaskArgument argument; const be_t eaElf_addr; //void *eaElf const be_t eaContext_addr; //void *eaContext be_t sizeContext; be_t state; be_t hasSignal; const be_t CellSpursTaskExitCode_addr; u8 guid[8]; //be_t reserved[]; }; struct CellSpursTaskBinInfo { be_t eaElf; be_t sizeContext; be_t __reserved__; CellSpursTaskLsPattern lsPattern; };