mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Log if Comp_SysCall encounters bad syscall instructions
This commit is contained in:
parent
7520c0e273
commit
62dcb9c70c
5 changed files with 19 additions and 12 deletions
|
@ -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()) {
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue