about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-06-30 14:13:53 +0200
committerGitHub <noreply@github.com>2022-06-30 14:13:53 +0200
commit26f8a756cbcb52b4c21ee6371d5e3caa66551bb8 (patch)
tree3d4e1e8ac06bbc751867cfa9533f586ac1dd5830
parent41744425582650a55300d85b68e69efcf586294e (diff)
parent452a390325ea98d88080465a616765d8b9d96437 (diff)
downloadbox64-26f8a756cbcb52b4c21ee6371d5e3caa66551bb8.tar.gz
box64-26f8a756cbcb52b4c21ee6371d5e3caa66551bb8.zip
Merge pull request #334 from martinmanyhats/pagesize64k
Enable 64k page size
-rwxr-xr-xCMakeLists.txt5
-rw-r--r--src/custommem.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a844ab6..5c8373d3 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,6 +53,7 @@ option(LD80BITS "Set to ON if host device have 80bits long double (i.e. i386)" $
 option(NOALIGN "Set to ON if host device doesn't need re-align (i.e. i386)" ${NOALIGN})
 option(ARM_DYNAREC "Set to ON to use ARM Dynamic Recompilation" ${ARM_DYNAREC})
 option(PAGE16K "Set to ON if host device have PageSize of 16K (instead of 4K)" ${PAGE16K})
+option(PAGE64K "Set to ON if host device have PageSize of 64K (instead of 4K)" ${PAGE64K})
 option(STATICBUILD "Set to ON to have a static build (Warning, not working)" ${STATICBUILD})
 
 if(${CMAKE_VERSION} VERSION_LESS "3.12.2")
@@ -137,6 +138,10 @@ if(PAGE16K)
     add_definitions(-DPAGE16K)
 endif()
 
+if(PAGE64K)
+    add_definitions(-DPAGE64K)
+endif()
+
 if(NOGIT)
     add_definitions(-DNOGIT)
 endif()
diff --git a/src/custommem.c b/src/custommem.c
index 02c371c9..186543fb 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -42,7 +42,10 @@ static uintptr_t*          box64_jmptbldefault1[1<<JMPTABL_SHIFT];
 static uintptr_t           box64_jmptbldefault0[1<<JMPTABL_SHIFT];
 #endif
 static pthread_mutex_t     mutex_prot;
-#if defined(PAGE16K)
+#if defined(PAGE64K)
+#define MEMPROT_SHIFT 16
+#define MEMPROT_SHIFT2 (16+16)
+#elif defined(PAGE16K)
 #define MEMPROT_SHIFT 14
 #define MEMPROT_SHIFT2 (16+14)
 #else