mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-16 17:43:11 +00:00
Merge pull request #322 from raven02/patch-16
cellSpurs : create new taskset using attr
This commit is contained in:
commit
c4e3ec825e
@ -1,5 +1,6 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "SPURSManager.h"
|
#include "SPURSManager.h"
|
||||||
|
#include "Emu/Memory/Memory.h"
|
||||||
|
|
||||||
SPURSManager::SPURSManager(SPURSManagerAttribute *attr)
|
SPURSManager::SPURSManager(SPURSManagerAttribute *attr)
|
||||||
{
|
{
|
||||||
@ -9,4 +10,20 @@ SPURSManager::SPURSManager(SPURSManagerAttribute *attr)
|
|||||||
void SPURSManager::Finalize()
|
void SPURSManager::Finalize()
|
||||||
{
|
{
|
||||||
delete this->attr;
|
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;
|
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.
|
// Main SPURS manager class.
|
||||||
class SPURSManager
|
class SPURSManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SPURSManager(SPURSManagerAttribute *attr);
|
SPURSManager(SPURSManagerAttribute *attr);
|
||||||
SPURSManager(SPURSManagerEventFlag *eventFlag);
|
|
||||||
void Finalize();
|
void Finalize();
|
||||||
|
void AttachLv2EventQueue(u32 queue, mem8_t port, int isDynamic);
|
||||||
|
void DetachLv2EventQueue(u8 port);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SPURSManagerAttribute *attr;
|
SPURSManagerAttribute *attr;
|
||||||
SPURSManagerEventFlag *eventFlag;
|
|
||||||
};
|
};
|
||||||
|
@ -135,6 +135,7 @@ int cellSpursAttributeSetMemoryContainerForSpuThread(mem_ptr_t<CellSpursAttribut
|
|||||||
}
|
}
|
||||||
|
|
||||||
attr->attr->_setMemoryContainerForSpuThread(container);
|
attr->attr->_setMemoryContainerForSpuThread(container);
|
||||||
|
|
||||||
return CELL_OK;
|
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)
|
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)
|
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;
|
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spurs->spurs->AttachLv2EventQueue(queue, port, isDynamic);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cellSpursDetachLv2EventQueue(mem_ptr_t<CellSpurs> spurs, u8 port)
|
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)
|
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;
|
return CELL_SPURS_CORE_ERROR_NULL_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spurs->spurs->DetachLv2EventQueue(port);
|
||||||
|
|
||||||
return CELL_OK;
|
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;
|
return CELL_SPURS_TASK_ERROR_NULL_POINTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SPURSManagerTasksetAttribute *tattr = new SPURSManagerTasksetAttribute(args, priority, maxContention);
|
||||||
|
taskset->taskset = new SPURSManagerTaskset(taskset.GetAddr(), tattr);
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,16 @@ struct CellSpursAttribute
|
|||||||
SPURSManagerAttribute *attr;
|
SPURSManagerAttribute *attr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CellSpursEventFlag
|
||||||
|
{
|
||||||
|
SPURSManagerEventFlag *eventFlag;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct CellSpursTaskset
|
||||||
|
{
|
||||||
|
SPURSManagerTaskset *taskset;
|
||||||
|
};
|
||||||
|
|
||||||
struct CellSpursInfo
|
struct CellSpursInfo
|
||||||
{
|
{
|
||||||
be_t<s32> nSpus;
|
be_t<s32> nSpus;
|
||||||
@ -135,12 +145,6 @@ struct CellSpursTracePacket
|
|||||||
} data;
|
} data;
|
||||||
};
|
};
|
||||||
|
|
||||||
// cellSpurs taskset structures.
|
|
||||||
struct CellSpursTaskset
|
|
||||||
{
|
|
||||||
u8 skip[6400];
|
|
||||||
};
|
|
||||||
|
|
||||||
// Exception handlers.
|
// Exception handlers.
|
||||||
typedef void (*CellSpursGlobalExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs, const mem_ptr_t<CellSpursExceptionInfo> info,
|
typedef void (*CellSpursGlobalExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs, const mem_ptr_t<CellSpursExceptionInfo> info,
|
||||||
u32 id, mem_ptr_t<void> arg);
|
u32 id, mem_ptr_t<void> arg);
|
||||||
@ -241,7 +245,3 @@ struct CellSpursTaskBinInfo
|
|||||||
be_t<u32> __reserved__;
|
be_t<u32> __reserved__;
|
||||||
CellSpursTaskLsPattern lsPattern;
|
CellSpursTaskLsPattern lsPattern;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CellSpursEventFlag {
|
|
||||||
SPURSManagerEventFlag *eventFlag;
|
|
||||||
};
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user