diff --git a/rpcs3/Emu/Cell/SPURSManager.h b/rpcs3/Emu/Cell/SPURSManager.h index 96585674b4..ab250b44a4 100644 --- a/rpcs3/Emu/Cell/SPURSManager.h +++ b/rpcs3/Emu/Cell/SPURSManager.h @@ -54,8 +54,10 @@ public: this->spuThreadGroupPriority = spuPriority; this->ppuThreadPriority = ppuPriority; this->exitIfNoWork = exitIfNoWork; + memset(this->namePrefix, 0, CELL_SPURS_NAME_MAX_LENGTH + 1); this->threadGroupType = 0; + this->container = 0; } int _setNamePrefix(const char *name, u32 size) @@ -71,13 +73,20 @@ public: return 0; } + int _setMemoryContainerForSpuThread(u32 container) + { + this->container = container; + return 0; + } + protected: be_t nSpus; be_t spuThreadGroupPriority; be_t ppuThreadPriority; bool exitIfNoWork; char namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1]; - be_t threadGroupType; + be_t threadGroupType; + be_t container; }; // Main SPURS manager class. @@ -89,4 +98,4 @@ public: protected: SPURSManagerAttribute *attr; -}; \ No newline at end of file +}; diff --git a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp index ce7bea7233..64beea41d3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSpurs.cpp @@ -75,12 +75,13 @@ int _cellSpursAttributeInitialize(mem_ptr_t attr, int nSpus, int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t attr, u32 container) { - cellSpurs.Error("cellSpursAttributeSetMemoryContainerForSpuThread(attr_addr=0x%x, container=0x%x)", + cellSpurs.Warning("cellSpursAttributeSetMemoryContainerForSpuThread(attr_addr=0x%x, container=0x%x)", attr.GetAddr(), container); if(!attr.IsGood()) return CELL_SPURS_CORE_ERROR_NULL_POINTER; + attr->attr->_setMemoryContainerForSpuThread(container); return CELL_OK; } @@ -122,8 +123,8 @@ int cellSpursAttributeSetSpuThreadGroupType(mem_ptr_t attr, return CELL_OK; } -int cellSpursAttributeEnableSystemWorkload(mem_ptr_t attr, const u8 priority[8], - u32 maxSpu, const bool isPreemptible[8]) +int cellSpursAttributeEnableSystemWorkload(mem_ptr_t attr, const u8 priority[CELL_SPURS_MAX_SPU], + u32 maxSpu, const bool isPreemptible[CELL_SPURS_MAX_SPU]) { cellSpurs.Error("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority[%u], maxSpu=%u, isPreemptible[%u])", attr.GetAddr(), priority, maxSpu, isPreemptible); @@ -131,7 +132,7 @@ int cellSpursAttributeEnableSystemWorkload(mem_ptr_t attr, c if(!attr.IsGood()) return CELL_SPURS_CORE_ERROR_NULL_POINTER; - for (int i=0; i<8; i++) + for (int i = 0; i < CELL_SPURS_MAX_SPU; i++) if(priority[i] != 1 || maxSpu == 0) return CELL_SPURS_CORE_ERROR_INVAL; @@ -204,7 +205,7 @@ int cellSpursSetPriority(mem_ptr_t spurs, u32 workloadId, u32 spuId, return CELL_OK; } -int cellSpursSetPreemptionVictimHints(mem_ptr_t spurs, const bool isPreemptible[8]) +int cellSpursSetPreemptionVictimHints(mem_ptr_t spurs, const bool isPreemptible[CELL_SPURS_MAX_SPU]) { cellSpurs.Error("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible[%u])", spurs.GetAddr(), isPreemptible); @@ -430,4 +431,4 @@ void cellSpurs_init() cellSpurs.AddFunc(0xe7dd87e1, cellSpursGetTasksetId); cellSpurs.AddFunc(0xa789e631, cellSpursShutdownTaskset); cellSpurs.AddFunc(0xbeb600ac, cellSpursCreateTask); -} \ No newline at end of file +}