mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-14 06:50:29 +02:00
Invalidate code that HLE and the debugger write over
Helper thread stubs, fake syscall stubs and the module start trampoline go into memory that may have held code (freed kernel memory, a reused thread stack), and the debugger memory views can edit code. Invalidate what they write, which so far only happened by accident when the write hit the first instruction of a JIT block. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
59fed92dac
commit
0a8ec4d8f1
5 files changed
+21
-2
No files matched your search
@@ -2808,6 +2808,8 @@ int __KernelStartModule(SceUID moduleId, u32 argsize, u32 argAddr, u32 returnVal
|
||||
Memory::WriteUnchecked_U32(MIPS_MAKE_LW(MIPS_REG_RA, MIPS_REG_SP, 8), tramp + 0x24);
|
||||
Memory::WriteUnchecked_U32(MIPS_MAKE_J(entryAddr), tramp + 0x28);
|
||||
Memory::WriteUnchecked_U32(MIPS_MAKE_ADDIU(MIPS_REG_SP, MIPS_REG_SP, 16), tramp + 0x2C);
|
||||
// Thread stacks get reused, so an older trampoline may already be compiled here.
|
||||
currentMIPS->InvalidateICacheRangeDeferred(tramp, 0x30);
|
||||
NotifyMemInfo(MemBlockFlags::WRITE, tramp, 0x30, "ModuleStartTrampoline");
|
||||
startThread->context.pc = tramp;
|
||||
startThread->nt.entrypoint = tramp;
|
||||
|
||||
Reference in new issue
Block a user