mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 21:32:50 +00:00
Merge branch 'master' of https://github.com/DHrpcs3/rpcs3
This commit is contained in:
commit
aed250d3b0
@ -1,5 +1,6 @@
|
||||
#include "stdafx.h"
|
||||
#include "Emu/SysCalls/ErrorCodes.h"
|
||||
#include "Emu/SysCalls/SysCalls.h"
|
||||
#include "Utilities/Log.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
@ -285,8 +286,8 @@ void _se_translator(unsigned int u, EXCEPTION_POINTERS* pExp)
|
||||
// TODO: allow recovering from a page fault
|
||||
//GetCurrentPPUThread().Stop();
|
||||
Emu.Pause();
|
||||
throw fmt::Format("Access violation: addr = 0x%x (last_syscall=0x%llx)",
|
||||
(u32)addr, (u64)GetCurrentCPUThread()->m_last_syscall);
|
||||
throw fmt::Format("Access violation: addr = 0x%x (last_syscall=0x%llx (%s))",
|
||||
(u32)addr, (u64)GetCurrentCPUThread()->m_last_syscall, SysCalls::GetHLEFuncName((u64)GetCurrentCPUThread()->m_last_syscall).c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -266,13 +266,13 @@ public:
|
||||
#endif
|
||||
{
|
||||
m_base_addr = nullptr;
|
||||
LOG_ERROR(MEMORY, "Initialing memory failed");
|
||||
LOG_ERROR(MEMORY, "Initializing memory failed");
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_NOTICE(MEMORY, "Initialing memory: m_base_addr = 0x%llx", (u64)m_base_addr);
|
||||
LOG_NOTICE(MEMORY, "Initializing memory: m_base_addr = 0x%llx", (u64)m_base_addr);
|
||||
}
|
||||
|
||||
switch(type)
|
||||
|
@ -471,7 +471,7 @@ int cellSpursEventFlagGetClearMode(mem_ptr_t<CellSpursEventFlag> eventFlag, mem3
|
||||
|
||||
int cellSpursEventFlagGetTasksetAddress(mem_ptr_t<CellSpursEventFlag> eventFlag, mem_ptr_t<CellSpursTaskset> taskset)
|
||||
{
|
||||
cellSpurs->Todo("cellSpursEventFlagTryWait(eventFlag_addr=0x%x, taskset_addr=0x%x)", eventFlag.GetAddr(), taskset.GetAddr());
|
||||
cellSpurs->Todo("cellSpursEventFlagGetTasksetAddress(eventFlag_addr=0x%x, taskset_addr=0x%x)", eventFlag.GetAddr(), taskset.GetAddr());
|
||||
|
||||
if (eventFlag.GetAddr() % 128 != 0)
|
||||
{
|
||||
@ -716,9 +716,23 @@ int cellSpursTasksetAttributeSetName()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int _cellSpursTasksetAttribute2Initialize()
|
||||
int _cellSpursTasksetAttribute2Initialize(mem_ptr_t<CellSpursTasksetAttribute2> attribute, u32 revision)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSpurs);
|
||||
cellSpurs->Warning("_cellSpursTasksetAttribute2Initialize(attribute_addr=0x%x, revision=%d)", attribute.GetAddr(), revision);
|
||||
|
||||
attribute->revision = revision;
|
||||
attribute->name_addr = NULL;
|
||||
attribute->argTaskset = 0;
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
attribute->priority[i] = 1;
|
||||
}
|
||||
|
||||
attribute->maxContention = 8;
|
||||
attribute->enableClearLs = 0;
|
||||
attribute->CellSpursTaskNameBuffer_addr = 0;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -770,9 +784,26 @@ int cellSpursTaskAttributeSetExitCodeContainer()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int _cellSpursTaskAttribute2Initialize()
|
||||
int _cellSpursTaskAttribute2Initialize(mem_ptr_t<CellSpursTaskAttribute2> attribute, u32 revision)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellSpurs);
|
||||
cellSpurs->Warning("_cellSpursTaskAttribute2Initialize(attribute_addr=0x%x, revision=%d)", attribute.GetAddr(), revision);
|
||||
|
||||
attribute->revision = revision;
|
||||
attribute->sizeContext = 0;
|
||||
attribute->eaContext = NULL;
|
||||
|
||||
for (int c = 0; c < 4; c++)
|
||||
{
|
||||
attribute->lsPattern.u32[c] = 0;
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
attribute->lsPattern.u64[i] = 0;
|
||||
}
|
||||
|
||||
attribute->name_addr = 0;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -26,30 +26,30 @@ enum
|
||||
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_STAT = 0x8041090F,
|
||||
CELL_SPURS_TASK_ERROR_NULL_POINTER = 0x80410911,
|
||||
CELL_SPURS_TASK_ERROR_FATAL = 0x80410914,
|
||||
CELL_SPURS_TASK_ERROR_SHUTDOWN = 0x80410920,
|
||||
CELL_SPURS_TASK_ERROR_SHUTDOWN = 0x80410920,
|
||||
};
|
||||
|
||||
// Core CellSpurs structures.
|
||||
struct CellSpurs
|
||||
{
|
||||
SPURSManager *spurs;
|
||||
{
|
||||
SPURSManager *spurs;
|
||||
};
|
||||
|
||||
struct CellSpurs2
|
||||
{
|
||||
{
|
||||
SPURSManager *spurs;
|
||||
};
|
||||
|
||||
struct CellSpursAttribute
|
||||
{
|
||||
SPURSManagerAttribute *attr;
|
||||
{
|
||||
SPURSManagerAttribute *attr;
|
||||
};
|
||||
|
||||
struct CellSpursEventFlag
|
||||
struct CellSpursEventFlag
|
||||
{
|
||||
SPURSManagerEventFlag *eventFlag;
|
||||
};
|
||||
@ -60,87 +60,87 @@ struct CellSpursTaskset
|
||||
};
|
||||
|
||||
struct CellSpursInfo
|
||||
{
|
||||
{
|
||||
be_t<s32> nSpus;
|
||||
be_t<s32> spuThreadGroupPriority;
|
||||
be_t<s32> ppuThreadPriority;
|
||||
bool exitIfNoWork;
|
||||
bool spurs2;
|
||||
be_t<s32> ppuThreadPriority;
|
||||
bool exitIfNoWork;
|
||||
bool spurs2;
|
||||
be_t<u32> traceBuffer_addr; //void *traceBuffer;
|
||||
be_t<u64> traceBufferSize;
|
||||
be_t<u32> traceMode;
|
||||
be_t<u64> traceBufferSize;
|
||||
be_t<u32> traceMode;
|
||||
be_t<u32> spuThreadGroup; //typedef u32 sys_spu_thread_group_t;
|
||||
be_t<u32> spuThreads[8]; //typedef u32 sys_spu_thread_t;
|
||||
be_t<u32> spursHandlerThread0;
|
||||
be_t<u32> spursHandlerThread1;
|
||||
s8 namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1];
|
||||
be_t<u64> namePrefixLength;
|
||||
be_t<u32> deadlineMissCounter;
|
||||
be_t<u32> deadlineMeetCounter;
|
||||
//u8 padding[];
|
||||
be_t<u32> spursHandlerThread0;
|
||||
be_t<u32> spursHandlerThread1;
|
||||
s8 namePrefix[CELL_SPURS_NAME_MAX_LENGTH+1];
|
||||
be_t<u64> namePrefixLength;
|
||||
be_t<u32> deadlineMissCounter;
|
||||
be_t<u32> deadlineMeetCounter;
|
||||
//u8 padding[];
|
||||
};
|
||||
|
||||
struct CellSpursExceptionInfo
|
||||
{
|
||||
be_t<u32> spu_thread;
|
||||
be_t<u32> spu_npc;
|
||||
be_t<u32> cause;
|
||||
be_t<u64> option;
|
||||
struct CellSpursExceptionInfo
|
||||
{
|
||||
be_t<u32> spu_thread;
|
||||
be_t<u32> spu_npc;
|
||||
be_t<u32> cause;
|
||||
be_t<u64> option;
|
||||
};
|
||||
|
||||
struct CellSpursTraceInfo
|
||||
{
|
||||
be_t<u32> spu_thread[8];
|
||||
be_t<u32> count[8];
|
||||
be_t<u32> spu_thread_grp;
|
||||
be_t<u32> nspu;
|
||||
//u8 padding[];
|
||||
{
|
||||
be_t<u32> spu_thread[8];
|
||||
be_t<u32> count[8];
|
||||
be_t<u32> spu_thread_grp;
|
||||
be_t<u32> nspu;
|
||||
//u8 padding[];
|
||||
};
|
||||
|
||||
struct CellTraceHeader
|
||||
{
|
||||
u8 tag;
|
||||
u8 length;
|
||||
u8 cpu;
|
||||
u8 thread;
|
||||
be_t<u32> time;
|
||||
struct CellTraceHeader
|
||||
{
|
||||
u8 tag;
|
||||
u8 length;
|
||||
u8 cpu;
|
||||
u8 thread;
|
||||
be_t<u32> time;
|
||||
};
|
||||
|
||||
struct CellSpursTracePacket
|
||||
{
|
||||
{
|
||||
struct header_struct
|
||||
{
|
||||
u8 tag;
|
||||
u8 length;
|
||||
u8 spu;
|
||||
u8 workload;
|
||||
be_t<u32> time;
|
||||
{
|
||||
u8 tag;
|
||||
u8 length;
|
||||
u8 spu;
|
||||
u8 workload;
|
||||
be_t<u32> time;
|
||||
} header;
|
||||
|
||||
struct data_struct
|
||||
{
|
||||
struct load_struct
|
||||
{
|
||||
be_t<u32> ea;
|
||||
be_t<u16> ls;
|
||||
be_t<u16> size;
|
||||
} load;
|
||||
{
|
||||
be_t<u32> ea;
|
||||
be_t<u16> ls;
|
||||
be_t<u16> size;
|
||||
} load;
|
||||
|
||||
struct map_struct
|
||||
{
|
||||
be_t<u32> offset;
|
||||
be_t<u16> ls;
|
||||
be_t<u16> size;
|
||||
} map;
|
||||
{
|
||||
be_t<u32> offset;
|
||||
be_t<u16> ls;
|
||||
be_t<u16> size;
|
||||
} map;
|
||||
|
||||
struct start_struct
|
||||
{
|
||||
{
|
||||
s8 module[4];
|
||||
be_t<u16> level;
|
||||
be_t<u16> ls;
|
||||
} start;
|
||||
be_t<u16> level;
|
||||
be_t<u16> ls;
|
||||
} start;
|
||||
|
||||
be_t<u64> user;
|
||||
be_t<u64> user;
|
||||
be_t<u64> guid;
|
||||
} data;
|
||||
};
|
||||
@ -152,94 +152,94 @@ typedef void (*CellSpursGlobalExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs,
|
||||
typedef void (*CellSpursTasksetExceptionEventHandler)(mem_ptr_t<CellSpurs> spurs, mem_ptr_t<CellSpursTaskset> taskset,
|
||||
u32 idTask, const mem_ptr_t<CellSpursExceptionInfo> info, mem_ptr_t<void> arg);
|
||||
|
||||
struct CellSpursTasksetInfo
|
||||
{
|
||||
//CellSpursTaskInfo taskInfo[CELL_SPURS_MAX_TASK];
|
||||
be_t<u64> argument;
|
||||
be_t<u32> idWorkload;
|
||||
struct CellSpursTasksetInfo
|
||||
{
|
||||
//CellSpursTaskInfo taskInfo[CELL_SPURS_MAX_TASK];
|
||||
be_t<u64> argument;
|
||||
be_t<u32> idWorkload;
|
||||
be_t<u32> idLastScheduledTask; //typedef unsigned CellSpursTaskId
|
||||
be_t<u32> name_addr;
|
||||
CellSpursTasksetExceptionEventHandler exceptionEventHandler;
|
||||
be_t<u32> name_addr;
|
||||
CellSpursTasksetExceptionEventHandler exceptionEventHandler;
|
||||
be_t<u32> exceptionEventHandlerArgument_addr; //void *exceptionEventHandlerArgument
|
||||
be_t<u64> sizeTaskset;
|
||||
//be_t<u8> reserved[];
|
||||
be_t<u64> sizeTaskset;
|
||||
//be_t<u8> reserved[];
|
||||
};
|
||||
|
||||
struct CellSpursTaskset2
|
||||
struct CellSpursTaskset2
|
||||
{
|
||||
be_t<u8> skip[10496];
|
||||
};
|
||||
|
||||
struct CellSpursTasksetAttribute2
|
||||
{
|
||||
be_t<u32> revision;
|
||||
be_t<u32> name_addr;
|
||||
be_t<u64> argTaskset;
|
||||
u8 priority[8];
|
||||
be_t<u32> maxContention;
|
||||
be_t<s32> enableClearLs;
|
||||
struct CellSpursTasksetAttribute2
|
||||
{
|
||||
be_t<u32> revision;
|
||||
be_t<u32> name_addr;
|
||||
be_t<u64> argTaskset;
|
||||
u8 priority[8];
|
||||
be_t<u32> maxContention;
|
||||
be_t<s32> enableClearLs;
|
||||
be_t<s32> CellSpursTaskNameBuffer_addr; //??? *taskNameBuffer
|
||||
//be_t<u32> __reserved__[];
|
||||
//be_t<u32> __reserved__[];
|
||||
};
|
||||
|
||||
// cellSpurs task structures.
|
||||
struct CellSpursTaskNameBuffer
|
||||
{
|
||||
char taskName[CELL_SPURS_MAX_TASK][CELL_SPURS_MAX_TASK_NAME_LENGTH];
|
||||
struct CellSpursTaskNameBuffer
|
||||
{
|
||||
char taskName[CELL_SPURS_MAX_TASK][CELL_SPURS_MAX_TASK_NAME_LENGTH];
|
||||
};
|
||||
|
||||
struct CellSpursTraceTaskData
|
||||
{
|
||||
be_t<u32> incident;
|
||||
be_t<u32> task;
|
||||
struct CellSpursTraceTaskData
|
||||
{
|
||||
be_t<u32> incident;
|
||||
be_t<u32> task;
|
||||
};
|
||||
|
||||
typedef be_t<u32> be_u32;
|
||||
typedef be_t<u64> be_u64;
|
||||
|
||||
struct CellSpursTaskArgument
|
||||
{
|
||||
be_u32 u32[4];
|
||||
be_u64 u64[2];
|
||||
};
|
||||
|
||||
struct CellSpursTaskLsPattern
|
||||
struct CellSpursTaskArgument
|
||||
{
|
||||
be_u32 u32[4];
|
||||
be_u64 u64[2];
|
||||
};
|
||||
|
||||
struct CellSpursTaskAttribute2
|
||||
{
|
||||
be_t<u32> revision;
|
||||
be_t<u32> sizeContext;
|
||||
be_t<u64> eaContext;
|
||||
CellSpursTaskLsPattern lsPattern; //???
|
||||
be_t<u32> name_addr;
|
||||
//be_t<u32> __reserved__[];
|
||||
struct CellSpursTaskLsPattern
|
||||
{
|
||||
be_u32 u32[4];
|
||||
be_u64 u64[2];
|
||||
};
|
||||
|
||||
struct CellSpursTaskExitCode
|
||||
struct CellSpursTaskAttribute2
|
||||
{
|
||||
be_t<u32> revision;
|
||||
be_t<u32> sizeContext;
|
||||
be_t<u64> eaContext;
|
||||
CellSpursTaskLsPattern lsPattern;
|
||||
be_t<u32> name_addr;
|
||||
//be_t<u32> __reserved__[];
|
||||
};
|
||||
|
||||
struct CellSpursTaskExitCode
|
||||
{
|
||||
unsigned char skip[128];
|
||||
};
|
||||
|
||||
struct CellSpursTaskInfo
|
||||
{
|
||||
CellSpursTaskLsPattern lsPattern;
|
||||
CellSpursTaskArgument argument;
|
||||
struct CellSpursTaskInfo
|
||||
{
|
||||
CellSpursTaskLsPattern lsPattern;
|
||||
CellSpursTaskArgument argument;
|
||||
const be_t<u32> eaElf_addr; //void *eaElf
|
||||
const be_t<u32> eaContext_addr; //void *eaContext
|
||||
be_t<u32> sizeContext;
|
||||
be_t<u8> state;
|
||||
be_t<u8> hasSignal;
|
||||
const be_t<u32> CellSpursTaskExitCode_addr;
|
||||
u8 guid[8];
|
||||
//be_t<u8> reserved[];
|
||||
be_t<u32> sizeContext;
|
||||
be_t<u8> state;
|
||||
be_t<u8> hasSignal;
|
||||
const be_t<u32> CellSpursTaskExitCode_addr;
|
||||
u8 guid[8];
|
||||
//be_t<u8> reserved[];
|
||||
};
|
||||
|
||||
struct CellSpursTaskBinInfo
|
||||
{
|
||||
struct CellSpursTaskBinInfo
|
||||
{
|
||||
be_t<u64> eaElf;
|
||||
be_t<u32> sizeContext;
|
||||
be_t<u32> __reserved__;
|
||||
|
Loading…
x
Reference in New Issue
Block a user