about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-10-01 15:03:44 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-10-01 15:03:44 +0200
commit582c7c762a53fd13d48faf4083b116de1e77f3ed (patch)
treee0f483e9c8db3b4fec3db7723fb867663f1a060b /src/include
parent3ad64aa6a4b06ccd937c54b1696c61a24fc828dc (diff)
downloadbox64-582c7c762a53fd13d48faf4083b116de1e77f3ed.tar.gz
box64-582c7c762a53fd13d48faf4083b116de1e77f3ed.zip
[DYNAREC] Introduce a config that should save a bit of mmemory at runtime (ON for PIs and RK3399 only for now)
Diffstat (limited to 'src/include')
-rw-r--r--src/include/custommem.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/custommem.h b/src/include/custommem.h
index d3536ae3..ac715b52 100644
--- a/src/include/custommem.h
+++ b/src/include/custommem.h
@@ -36,6 +36,23 @@ uintptr_t getJumpTable64(void);
 uintptr_t getJumpTableAddress64(uintptr_t addr);
 uintptr_t getJumpAddress64(uintptr_t addr);
 
+#ifdef SAVE_MEM
+#define JMPTABL_SHIFT4 16
+#define JMPTABL_SHIFT3 14
+#define JMPTABL_SHIFT2 12
+#define JMPTABL_SHIFT1 12
+#define JMPTABL_SHIFT0 10
+#define JMPTABL_START4 (JMPTABL_START3+JMPTABL_SHIFT3)
+#define JMPTABL_START3 (JMPTABL_START2+JMPTABL_SHIFT2)
+#define JMPTABL_START2 (JMPTABL_START1+JMPTABL_SHIFT1)
+#define JMPTABL_START1 (JMPTABL_START0+JMPTABL_SHIFT0)
+#define JMPTABL_START0 0
+#define JMPTABLE_MASK4 ((1<<JMPTABL_SHIFT4)-1)
+#define JMPTABLE_MASK3 ((1<<JMPTABL_SHIFT3)-1)
+#define JMPTABLE_MASK2 ((1<<JMPTABL_SHIFT2)-1)
+#define JMPTABLE_MASK1 ((1<<JMPTABL_SHIFT1)-1)
+#define JMPTABLE_MASK0 ((1<<JMPTABL_SHIFT0)-1)
+#else
 #define JMPTABL_SHIFT3 18
 #define JMPTABL_SHIFT2 18
 #define JMPTABL_SHIFT1 18
@@ -48,6 +65,7 @@ uintptr_t getJumpAddress64(uintptr_t addr);
 #define JMPTABLE_MASK2 ((1<<JMPTABL_SHIFT2)-1)
 #define JMPTABLE_MASK1 ((1<<JMPTABL_SHIFT1)-1)
 #define JMPTABLE_MASK0 ((1<<JMPTABL_SHIFT0)-1)
+#endif //SAVE_MEM
 #endif
 
 #define PROT_DYNAREC    0x80