Skip to content

Commit 5320a98

Browse files
committed
stop interrupts during patching and and flush cache after
1 parent 509e636 commit 5320a98

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

RemoteJoyLite_psp/hook.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,16 @@ extern void HookFuncSetting( void *addr, void *entry );
4343
{ \
4444
u32 func = a; \
4545
static u32 patch_buffer[3]; \
46+
int _interrupts = pspSdkDisableInterrupts(); \
4647
_sw(_lw(func), (u32)patch_buffer); \
4748
_sw(_lw(func + 4), (u32)patch_buffer + 8);\
4849
MAKE_JUMP((u32)patch_buffer + 4, func + 8); \
4950
_sw(0x08000000 | (((u32)(f) >> 2) & 0x03FFFFFF), func); \
5051
_sw(0, func + 4); \
5152
ptr = (void *)patch_buffer; \
53+
sceKernelDcacheWritebackInvalidateAll(); \
54+
sceKernelIcacheClearAll(); \
55+
pspSdkEnableInterrupts(_interrupts); \
5256
}
5357

5458
u32 sctrlHENFindFunction(const char *, const char*, u32);

0 commit comments

Comments
 (0)