mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-24 19:59:08 +02:00
ME: Syscalls to the firmware's cache functions do nothing
Kernel code the ME runs calls a few firmware functions directly: POPS's ME loop calls sceKernelDcacheWritebackInvalidateAll for every sample. On a PSP the loader links kernel imports as direct jumps, so the ME runs the function's code; here they're HLE syscall stubs. The cache functions only work on the calling CPU's caches, and the ME's aren't emulated, so they return 0 and do nothing, as does an unresolved import (as on the main CPU). Others are still an error, now naming the function. The IR ends the block after one, as for a syscall on the main CPU: a jr with it in its delay slot leaves the exit to it, and the ME ran on into the next stub. A syscall instruction of the ME's own should take its exception vector (ExcCode 8); none has come up yet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
6936d22b38
commit
bafdb45128
4 files changed
+53
-5
No files matched your search
@@ -27,6 +27,7 @@
|
||||
#include "Core/CoreTiming.h"
|
||||
#include "Core/ELF/PrxDecrypter.h"
|
||||
#include "Core/FileSystems/MetaFileSystem.h"
|
||||
#include "Core/HLE/HLE.h"
|
||||
#include "Core/HLE/sceKernelInterrupt.h"
|
||||
#include "Core/HLE/sceKernelMemory.h"
|
||||
#include "Core/MemMap.h"
|
||||
@@ -552,6 +553,25 @@ static void RunUntilIdle(MEState *me) {
|
||||
}
|
||||
}
|
||||
|
||||
bool SyscallDoesNothing(MIPSOpcode op, u32 pc) {
|
||||
static const char *const cacheFunctions[] = {
|
||||
"sceKernelDcacheWritebackAll",
|
||||
"sceKernelDcacheWritebackInvalidateAll",
|
||||
"sceKernelDcacheWritebackRange",
|
||||
"sceKernelDcacheWritebackInvalidateRange",
|
||||
"sceKernelDcacheInvalidateRange",
|
||||
};
|
||||
const HLEFunction *func = GetSyscallFunctionData(op, pc);
|
||||
if (!func)
|
||||
return true;
|
||||
for (const char *name : cacheFunctions) {
|
||||
if (!strcmp(func->name, name))
|
||||
return true;
|
||||
}
|
||||
ERROR_LOG(Log::ME, "syscall to %s on the Media Engine at %08x", func->name, pc);
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetReset(bool asserted) {
|
||||
MEState *me = g_meState;
|
||||
if (asserted) {
|
||||
|
||||
Reference in new issue
Block a user