Log if Comp_SysCall encounters bad syscall instructions

This commit is contained in:
Henrik Rydgård authored and Henrik Rydgard committed 2017-03-10 00:13:06 +01:00
1 parent 7520c0e273
commit 62dcb9c70c
5 files changed
+19 -12

No files matched your search

+6 -12
View File
@@ -175,24 +175,18 @@ const char *GetFuncName(const char *moduleName, u32 nib)
return temp;
}
u32 GetSyscallOp(const char *moduleName, u32 nib)
{
u32 GetSyscallOp(const char *moduleName, u32 nib) {
// Special case to hook up bad imports.
if (moduleName == NULL)
{
if (moduleName == NULL) {
return (0x03FFFFCC); // invalid syscall
}
int modindex = GetModuleIndex(moduleName);
if (modindex != -1)
{
if (modindex != -1) {
int funcindex = GetFuncIndex(modindex, nib);
if (funcindex != -1)
{
if (funcindex != -1) {
return (0x0000000c | (modindex<<18) | (funcindex<<6));
}
else
{
} else {
INFO_LOG(HLE, "Syscall (%s, %08x) unknown", moduleName, nib);
return (0x0003FFCC | (modindex<<18)); // invalid syscall
}
@@ -484,7 +478,7 @@ const HLEFunction *GetSyscallFuncPointer(MIPSOpcode op)
int funcnum = callno & 0xFFF;
int modulenum = (callno & 0xFF000) >> 12;
if (funcnum == 0xfff) {
ERROR_LOG(HLE, "Unknown syscall: Module: %s", modulenum > (int) moduleDB.size() ? "(unknown)" : moduleDB[modulenum].name);
ERROR_LOG(HLE, "Unknown syscall: Module: %s (module: %d func: %d)", modulenum > (int)moduleDB.size() ? "(unknown)" : moduleDB[modulenum].name, modulenum, funcnum);
return NULL;
}
if (modulenum >= (int)moduleDB.size()) {
+4
View File
@@ -586,6 +586,10 @@ void ArmJit::Comp_JumpReg(MIPSOpcode op)
void ArmJit::Comp_Syscall(MIPSOpcode op)
{
if (op.encoding == 0x03FFFFcc) {
WARN_LOG(JIT, "Encountered bad syscall instruction at %08x (%08x)", js.compilerPC, op.encoding);
}
if (!g_Config.bSkipDeadbeefFilling)
{
// All of these will be overwritten with DEADBEEF anyway.
+2
View File
@@ -83,6 +83,8 @@ ArmJit::ArmJit(MIPSState *mips) : blocks(mips, this), gpr(mips, &js, &jo), fpr(m
AllocCodeSpace(1024 * 1024 * 16); // 32MB is the absolute max because that's what an ARM branch instruction can reach, backwards and forwards.
GenerateFixedCode();
INFO_LOG(JIT, "ARM JIT initialized: %d MB of code space", GetSpaceLeft() / 1024 * 1024);
js.startDefaultPrefix = mips_->HasDefaultPrefix();
}
+3
View File
@@ -569,6 +569,9 @@ void Arm64Jit::Comp_JumpReg(MIPSOpcode op)
void Arm64Jit::Comp_Syscall(MIPSOpcode op)
{
if (op.encoding == 0x03FFFFcc) {
WARN_LOG(JIT, "Encountered bad syscall instruction at %08x (%08x)", js.compilerPC, op.encoding);
}
if (!g_Config.bSkipDeadbeefFilling)
{
// All of these will be overwritten with DEADBEEF anyway.
+4
View File
@@ -760,6 +760,10 @@ void Jit::Comp_JumpReg(MIPSOpcode op)
void Jit::Comp_Syscall(MIPSOpcode op)
{
if (op.encoding == 0x03FFFFcc) {
WARN_LOG(JIT, "Encountered bad syscall instruction at %08x (%08x)", js.compilerPC, op.encoding);
}
if (!g_Config.bSkipDeadbeefFilling)
{
// All of these will be overwritten with DEADBEEF anyway.