Merge pull request #288 from raven02/patch-29

Implement cellSpursAttributeSetMemoryContainerForSpuThread
This commit is contained in:
Alexandro Sánchez Bach 2014-05-31 10:53:39 +02:00
commit 834f5dc9a9
2 changed files with 18 additions and 8 deletions

View File

@ -54,8 +54,10 @@ public:
this->spuThreadGroupPriority = spuPriority; this->spuThreadGroupPriority = spuPriority;
this->ppuThreadPriority = ppuPriority; this->ppuThreadPriority = ppuPriority;
this->exitIfNoWork = exitIfNoWork; this->exitIfNoWork = exitIfNoWork;
memset(this->namePrefix, 0, CELL_SPURS_NAME_MAX_LENGTH + 1); memset(this->namePrefix, 0, CELL_SPURS_NAME_MAX_LENGTH + 1);
this->threadGroupType = 0; this->threadGroupType = 0;
this->container = 0;
} }
int _setNamePrefix(const char *name, u32 size) int _setNamePrefix(const char *name, u32 size)
@ -71,6 +73,12 @@ public:
return 0; return 0;
} }
int _setMemoryContainerForSpuThread(u32 container)
{
this->container = container;
return 0;
}
protected: protected:
be_t<int> nSpus; be_t<int> nSpus;
be_t<int> spuThreadGroupPriority; be_t<int> spuThreadGroupPriority;
@ -78,6 +86,7 @@ protected:
bool exitIfNoWork; bool exitIfNoWork;
char namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1]; char namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1];
be_t<int> threadGroupType; be_t<int> threadGroupType;
be_t<u32> container;
}; };
// Main SPURS manager class. // Main SPURS manager class.

View File

@ -75,12 +75,13 @@ int _cellSpursAttributeInitialize(mem_ptr_t<CellSpursAttribute> attr, int nSpus,
int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t<CellSpursAttribute> attr, u32 container) int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t<CellSpursAttribute> 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); attr.GetAddr(), container);
if(!attr.IsGood()) if(!attr.IsGood())
return CELL_SPURS_CORE_ERROR_NULL_POINTER; return CELL_SPURS_CORE_ERROR_NULL_POINTER;
attr->attr->_setMemoryContainerForSpuThread(container);
return CELL_OK; return CELL_OK;
} }
@ -122,8 +123,8 @@ int cellSpursAttributeSetSpuThreadGroupType(mem_ptr_t<CellSpursAttribute> attr,
return CELL_OK; return CELL_OK;
} }
int cellSpursAttributeEnableSystemWorkload(mem_ptr_t<CellSpursAttribute> attr, const u8 priority[8], int cellSpursAttributeEnableSystemWorkload(mem_ptr_t<CellSpursAttribute> attr, const u8 priority[CELL_SPURS_MAX_SPU],
u32 maxSpu, const bool isPreemptible[8]) u32 maxSpu, const bool isPreemptible[CELL_SPURS_MAX_SPU])
{ {
cellSpurs.Error("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority[%u], maxSpu=%u, isPreemptible[%u])", cellSpurs.Error("cellSpursAttributeEnableSystemWorkload(attr_addr=0x%x, priority[%u], maxSpu=%u, isPreemptible[%u])",
attr.GetAddr(), priority, maxSpu, isPreemptible); attr.GetAddr(), priority, maxSpu, isPreemptible);
@ -131,7 +132,7 @@ int cellSpursAttributeEnableSystemWorkload(mem_ptr_t<CellSpursAttribute> attr, c
if(!attr.IsGood()) if(!attr.IsGood())
return CELL_SPURS_CORE_ERROR_NULL_POINTER; 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) if(priority[i] != 1 || maxSpu == 0)
return CELL_SPURS_CORE_ERROR_INVAL; return CELL_SPURS_CORE_ERROR_INVAL;
@ -204,7 +205,7 @@ int cellSpursSetPriority(mem_ptr_t<CellSpurs> spurs, u32 workloadId, u32 spuId,
return CELL_OK; return CELL_OK;
} }
int cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, const bool isPreemptible[8]) int cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, const bool isPreemptible[CELL_SPURS_MAX_SPU])
{ {
cellSpurs.Error("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible[%u])", cellSpurs.Error("cellSpursSetPreemptionVictimHints(spurs_addr=0x%x, isPreemptible[%u])",
spurs.GetAddr(), isPreemptible); spurs.GetAddr(), isPreemptible);