diff --git a/src/ARMJIT_A64/ARMJIT_Compiler.cpp b/src/ARMJIT_A64/ARMJIT_Compiler.cpp index 89d00298..b598ac81 100644 --- a/src/ARMJIT_A64/ARMJIT_Compiler.cpp +++ b/src/ARMJIT_A64/ARMJIT_Compiler.cpp @@ -8,6 +8,9 @@ #include "../switch/compat_switch.h" extern char __start__; +#else +#include +#include #endif #include @@ -34,6 +37,9 @@ template <> const int RegisterCache::NativeRegsAvailable = 8; const int JitMemSize = 16 * 1024 * 1024; +#ifndef __SWITCH__ +u8 JitMem[JitMemSize]; +#endif void Compiler::MovePC() { @@ -76,6 +82,16 @@ Compiler::Compiler() SetCodeBase((u8*)JitRWStart, (u8*)JitRXStart); JitMemUseableSize = JitMemSize; Reset(); +#else + #else + u64 pageSize = sysconf(_SC_PAGE_SIZE); + u8* pageAligned = (u8*)(((u64)JitMem & ~(pageSize - 1)) + pageSize); + u64 alignedSize = (((u64)JitMem + sizeof(JitMem)) & ~(pageSize - 1)) - (u64)pageAligned; + mprotect(pageAligned, alignedSize, PROT_EXEC | PROT_READ | PROT_WRITE); + + SetCodeBase(pageAligned, pageAligned); + JitMemUseableSize = alignedSize; + Reset(); #endif for (int i = 0; i < 3; i++) diff --git a/src/dolphin/Arm64Emitter.cpp b/src/dolphin/Arm64Emitter.cpp index dbcf4257..dd2416ba 100644 --- a/src/dolphin/Arm64Emitter.cpp +++ b/src/dolphin/Arm64Emitter.cpp @@ -8,9 +8,9 @@ #include #include +#include "Compat.h" #include "Align.h" #include "Arm64Emitter.h" -#include "Assert.h" #include "BitUtils.h" #include "../types.h" #include "MathUtil.h" diff --git a/src/dolphin/Arm64Emitter.h b/src/dolphin/Arm64Emitter.h index 4cb9ff7c..3d9d4ba2 100644 --- a/src/dolphin/Arm64Emitter.h +++ b/src/dolphin/Arm64Emitter.h @@ -8,7 +8,6 @@ #include #include "ArmCommon.h" -#include "Assert.h" #include "BitSet.h" #include "Compat.h"