mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
cellSpurs: create new taskset using attr
This commit is contained in:
parent
7bb966ba82
commit
f051011fd1
@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "SPURSManager.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
SPURSManager::SPURSManager(SPURSManagerAttribute *attr)
|
||||
{
|
||||
@ -9,4 +10,20 @@ SPURSManager::SPURSManager(SPURSManagerAttribute *attr)
|
||||
void SPURSManager::Finalize()
|
||||
{
|
||||
delete this->attr;
|
||||
}
|
||||
}
|
||||
|
||||
void SPURSManager::AttachLv2EventQueue(u32 queue, mem8_t port, int isDynamic)
|
||||
{
|
||||
//TODO:
|
||||
}
|
||||
|
||||
void SPURSManager::DetachLv2EventQueue(u8 port)
|
||||
{
|
||||
//TODO:
|
||||
}
|
||||
|
||||
SPURSManagerTaskset::SPURSManagerTaskset(u32 address, SPURSManagerTasksetAttribute *tattr)
|
||||
{
|
||||
this->tattr = tattr;
|
||||
this->address = address;
|
||||
}
|
||||
|
@ -113,15 +113,40 @@ protected:
|
||||
be_t<u32> flagDirection;
|
||||
};
|
||||
|
||||
class SPURSManagerTasksetAttribute
|
||||
{
|
||||
public:
|
||||
SPURSManagerTasksetAttribute(u64 args, mem8_t priority, u32 maxContention)
|
||||
{
|
||||
this->args = args;
|
||||
this->maxContention = maxContention;
|
||||
}
|
||||
|
||||
protected:
|
||||
be_t<u64> args;
|
||||
be_t<u32> maxContention;
|
||||
};
|
||||
|
||||
class SPURSManagerTaskset
|
||||
{
|
||||
public:
|
||||
SPURSManagerTaskset(u32 address, SPURSManagerTasksetAttribute *tattr);
|
||||
|
||||
protected:
|
||||
u32 address;
|
||||
SPURSManagerTasksetAttribute *tattr;
|
||||
};
|
||||
|
||||
// Main SPURS manager class.
|
||||
class SPURSManager
|
||||
{
|
||||
public:
|
||||
SPURSManager(SPURSManagerAttribute *attr);
|
||||
SPURSManager(SPURSManagerEventFlag *eventFlag);
|
||||
|
||||
void Finalize();
|
||||
void AttachLv2EventQueue(u32 queue, mem8_t port, int isDynamic);
|
||||
void DetachLv2EventQueue(u8 port);
|
||||
|
||||
protected:
|
||||
SPURSManagerAttribute *attr;
|
||||
SPURSManagerEventFlag *eventFlag;
|
||||
};
|
||||
|
@ -135,6 +135,7 @@ int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t<CellSpursAttribut
|
||||
}
|
||||
|
||||
attr->attr->_setMemoryContainerForSpuThread(container);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -368,7 +369,7 @@ int cellSpursSetPreemptionVictimHints(mem_ptr_t<CellSpurs> spurs, const bool isP
|
||||
|
||||
int cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, mem8_t port, int isDynamic)
|
||||
{
|
||||
cellSpurs.Error("cellSpursAttachLv2EventQueue(spurs_addr=0x%x, queue=0x%x, port_addr=0x%x, isDynamic=%u)", spurs.GetAddr(), queue, port.GetAddr(), isDynamic);
|
||||
cellSpurs.Warning("cellSpursAttachLv2EventQueue(spurs_addr=0x%x, queue=0x%x, port_addr=0x%x, isDynamic=%u)", spurs.GetAddr(), queue, port.GetAddr(), isDynamic);
|
||||
|
||||
if (spurs.GetAddr() % 128 != 0)
|
||||
{
|
||||
@ -382,12 +383,14 @@ int cellSpursAttachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u32 queue, mem8_t p
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs->AttachLv2EventQueue(queue, port, isDynamic);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellSpursDetachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u8 port)
|
||||
{
|
||||
cellSpurs.Error("cellSpursDetachLv2EventQueue(spurs_addr=0x%x, port=0x%x)", spurs.GetAddr(), port);
|
||||
cellSpurs.Warning("cellSpursDetachLv2EventQueue(spurs_addr=0x%x, port=0x%x)", spurs.GetAddr(), port);
|
||||
|
||||
if (spurs.GetAddr() % 128 != 0)
|
||||
{
|
||||
@ -401,6 +404,8 @@ int cellSpursDetachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u8 port)
|
||||
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
spurs->spurs->DetachLv2EventQueue(port);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -954,6 +959,9 @@ int cellSpursCreateTaskset(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskse
|
||||
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
SPURSManagerTasksetAttribute *tattr = new SPURSManagerTasksetAttribute(args, priority, maxContention);
|
||||
taskset->taskset = new SPURSManagerTaskset(taskset.GetAddr(), tattr);
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,16 @@ struct CellSpursAttribute
|
||||
SPURSManagerAttribute *attr;
|
||||
};
|
||||
|
||||
struct CellSpursEventFlag
|
||||
{
|
||||
SPURSManagerEventFlag *eventFlag;
|
||||
};
|
||||
|
||||
struct CellSpursTaskset
|
||||
{
|
||||
SPURSManagerTaskset *taskset;
|
||||
};
|
||||
|
||||
struct CellSpursInfo
|
||||
{
|
||||
be_t<s32> nSpus;
|
||||
@ -135,12 +145,6 @@ struct CellSpursTracePacket
|
||||
} data;
|
||||
};
|
||||
|
||||
// cellSpurs taskset structures.
|
||||
struct CellSpursTaskset
|
||||
{
|
||||
u8 skip[6400];
|
||||
};
|
||||
|
||||
// Exception handlers.
|
||||
typedef void (*CellSpursGlobalExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs, const mem_ptr_t<CellSpursExceptionInfo> info,
|
||||
u32 id, mem_ptr_t<void> arg);
|
||||
@ -241,7 +245,3 @@ struct CellSpursTaskBinInfo
|
||||
be_t<u32> __reserved__;
|
||||
CellSpursTaskLsPattern lsPattern;
|
||||
};
|
||||
|
||||
struct CellSpursEventFlag {
|
||||
SPURSManagerEventFlag *eventFlag;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user