From 761fdd0a4ef77be843ff7a8fb10d33a4401965d5 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 23 Jan 2022 01:24:36 +0200 Subject: [PATCH] drc: align size passed to mprotect Maybe this makes svcControlProcessMemory() not do it's work there? It doesn't seem to be failing though. --- libpcsxcore/new_dynarec/new_dynarec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 8fe3f93d..bcbc0095 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -6789,7 +6789,7 @@ static void new_dynarec_test(void) SysPrintf("linkage_arm* miscompilation/breakage detected.\n"); } - SysPrintf("testing if we can run recompiled code...\n"); + SysPrintf("testing if we can run recompiled code @%p...\n", out); ((volatile u_int *)out)[0]++; // make cache dirty for (i = 0; i < ARRAY_SIZE(ret); i++) { @@ -6874,7 +6874,8 @@ void new_dynarec_init(void) #else #ifndef NO_WRITE_EXEC // not all systems allow execute in data segment by default - if (mprotect(ndrc, sizeof(ndrc->translation_cache) + sizeof(ndrc->tramp.ops), + // size must be 4K aligned for 3DS? + if (mprotect(ndrc, sizeof(*ndrc), PROT_READ | PROT_WRITE | PROT_EXEC) != 0) SysPrintf("mprotect() failed: %s\n", strerror(errno)); #endif -- 2.39.5