mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
Fix the JIT Code Memory on ARM64 Macs (#916)
This commit is contained in:
@ -25,6 +25,10 @@
|
||||
#include "Wifi.h"
|
||||
#include "NDSCart.h"
|
||||
|
||||
#if defined(__APPLE__) && defined(__aarch64__)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include "ARMJIT_x64/ARMJIT_Offsets.h"
|
||||
static_assert(offsetof(ARM, CPSR) == ARM_CPSR_offset, "");
|
||||
static_assert(offsetof(ARM, Cycles) == ARM_Cycles_offset, "");
|
||||
@ -306,6 +310,9 @@ void DeInit()
|
||||
|
||||
void Reset()
|
||||
{
|
||||
#if defined(__APPLE__) && defined(__aarch64__)
|
||||
pthread_jit_write_protect_np(false);
|
||||
#endif
|
||||
ResetBlockCache();
|
||||
|
||||
ARMJIT_Memory::Reset();
|
||||
@ -884,8 +891,13 @@ void CompileBlock(ARM* cpu)
|
||||
block->StartAddrLocal = localAddr;
|
||||
|
||||
FloodFillSetFlags(instrs, i - 1, 0xF);
|
||||
|
||||
#if defined(__APPLE__) && defined(__aarch64__)
|
||||
pthread_jit_write_protect_np(false);
|
||||
#endif
|
||||
block->EntryPoint = JITCompiler->CompileBlock(cpu, thumb, instrs, i);
|
||||
#if defined(__APPLE__) && defined(__aarch64__)
|
||||
pthread_jit_write_protect_np(true);
|
||||
#endif
|
||||
|
||||
JIT_DEBUGPRINT("block start %p\n", block->EntryPoint);
|
||||
}
|
||||
|
Reference in New Issue
Block a user