diff options
| author | Martin Reed <martin@martinreed.co.uk> | 2022-06-30 10:45:21 +0000 |
|---|---|---|
| committer | Martin Reed <martin@martinreed.co.uk> | 2022-06-30 10:45:21 +0000 |
| commit | 452a390325ea98d88080465a616765d8b9d96437 (patch) | |
| tree | 76f0db522a21b578669075a26651f8684de3f126 | |
| parent | 826f9cf2f39acf85cf78d4094d8f61e33372a3f2 (diff) | |
| download | box64-452a390325ea98d88080465a616765d8b9d96437.tar.gz box64-452a390325ea98d88080465a616765d8b9d96437.zip | |
Enable 64k page size eg Ampere A1.
| -rwxr-xr-x | CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/custommem.c | 5 |
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 |