Don't compile rec_arm64 on non ARM64 machines.
Include header in posix_vmem that makes calls to sys_cache_control compile on Mac ARM64. Replaces flyinghead#184
This commit is contained in:
parent
af650c7c31
commit
3c8a2f2372
|
@ -291,6 +291,8 @@ bool vmem_platform_prepare_jit_block(void *code_area, unsigned size, void **code
|
|||
|
||||
#if HOST_CPU == CPU_ARM64
|
||||
|
||||
#include <libkern/OSCacheControl.h>
|
||||
|
||||
// Code borrowed from Dolphin https://github.com/dolphin-emu/dolphin
|
||||
static void Arm64_CacheFlush(void* start, void* end) {
|
||||
if (start == end)
|
||||
|
@ -298,7 +300,7 @@ static void Arm64_CacheFlush(void* start, void* end) {
|
|||
|
||||
#if defined(__APPLE__)
|
||||
// Header file says this is equivalent to: sys_icache_invalidate(start, end - start);
|
||||
sys_cache_control(kCacheFunctionPrepareForExecution, start, end - start);
|
||||
sys_cache_control(kCacheFunctionPrepareForExecution, start, (uintptr_t)end - (uintptr_t)start);
|
||||
#else
|
||||
// Don't rely on GCC's __clear_cache implementation, as it caches
|
||||
// icache/dcache cache line sizes, that can vary between cores on
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include "types.h"
|
||||
|
||||
#if FEAT_SHREC == DYNAREC_JIT
|
||||
#if FEAT_SHREC == DYNAREC_JIT && HOST_CPU == CPU_ARM64
|
||||
|
||||
#include <unistd.h>
|
||||
#include <map>
|
||||
|
|
Loading…
Reference in New Issue