diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-03-20 15:26:07 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-03-20 15:26:07 +0100 |
| commit | 44a20349e3d07af9b1e65f261be2ed150e86b11e (patch) | |
| tree | e169b4aa087ddb24a82375311c700d2a0e5b2db5 | |
| parent | 7f7003c484787318182865bc737736531ad58535 (diff) | |
| download | box64-44a20349e3d07af9b1e65f261be2ed150e86b11e.tar.gz box64-44a20349e3d07af9b1e65f261be2ed150e86b11e.zip | |
Added M1/Asahi support
| -rwxr-xr-x | CMakeLists.txt | 7 | ||||
| -rw-r--r-- | src/custommem.c | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 75ece70a..658f0cff 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ option(ODROIDN2 "Set to ON if targeting an Odroid-N2 device" ${ODROIDN2}) option(TEGRAX1 "Set to ON if targeting an Tegra X1 based device" ${TEGRAX1}) option(PHYTIUM "Set to ON if targeting an Phytium (D2000 or FT2000/4) based device" ${PHYTIUM}) option(SD845 "Set to ON if targeting a Snapragon 845 based device" ${SD845}) +option(M1 "Set to ON if targeting a AppleM1 running on Asahi computer" ${M1}) option(LARCH64 "Set to ON if targeting an Loongarch64 based device" ${LARCH64}) option(RV64 "Set to ON if targeting an RISCV RV64G based device" ${RV64}) option(PPC64LE "Set to ON if targeting an PowerPC 64 LE based device" ${PPC64LE}) @@ -35,7 +36,7 @@ if(PPC64LE) set(NOALIGN OFF CACHE BOOL "") set(ARM_DYNAREC OFF CACHE BOOL "") endif() -if(RK3399 OR ODROIDN2 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR LX2160A) +if(RK3399 OR ODROIDN2 OR RPI4ARM64 OR RK3326 OR TEGRAX1 OR PHYTIUM OR SD845 OR LX2160A OR M1) set(LD80BITS OFF CACHE BOOL "") set(NOALIGN OFF CACHE BOOL "") set(ARM_DYNAREC ON CACHE BOOL "") @@ -100,6 +101,10 @@ elseif(SD845) add_definitions(-DSD845) add_definitions(-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55) set(CMAKE_ASM_FLAGS "-pipe -march=armv8.2-a+simd+crypto -mtune=cortex-a75.cortex-a55") +elseif(M1) + add_definitions(-DM1) + add_definitions(-pipe -march=armv8.5-a+simd+crypto) + set(CMAKE_ASM_FLAGS "-pipe -march=armv8.5-a+simd+crypto") elseif(LARCH64) add_definitions(-DLA464) add_definitions(-pipe -march=loongarch64) diff --git a/src/custommem.c b/src/custommem.c index 60336ecd..ede78b6f 100644 --- a/src/custommem.c +++ b/src/custommem.c @@ -42,7 +42,7 @@ static uintptr_t* box64_jmptbldefault1[1<<JMPTABL_SHIFT]; static uintptr_t box64_jmptbldefault0[1<<JMPTABL_SHIFT]; #endif static pthread_mutex_t mutex_prot; -#ifdef LA464 +#if defined(LA464) || defined(M1) #define MEMPROT_SHIFT 14 #define MEMPROT_SHIFT2 (16+14) #else |