about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-03-02 19:38:23 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-03-02 19:38:23 +0100
commitc4b57774f0b4794ad22e3e8c9fb4be760431b64e (patch)
tree7bed6efa782cceaec1634bd75f20c3dd564c4ec6 /src/include
parentf7acded7a1d3b3e349f55dd41f56818da0e5a283 (diff)
downloadbox64-c4b57774f0b4794ad22e3e8c9fb4be760431b64e.tar.gz
box64-c4b57774f0b4794ad22e3e8c9fb4be760431b64e.zip
[DYNAREC] Finetuned the jump table memory allocation
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/box64context.h1
-rw-r--r--src/include/custommem.h13
2 files changed, 13 insertions, 1 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h
index c8360017..3e55ff44 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -33,7 +33,6 @@ typedef struct mmaplist_s       mmaplist_t;
 typedef struct kh_dynablocks_s  kh_dynablocks_t;
 #endif
 #define DYNAMAP_SHIFT 16
-#define JMPTABL_SHIFT 16
 
 typedef void* (*procaddess_t)(const char* name);
 typedef void* (*vkprocaddess_t)(void* instance, const char* name);
diff --git a/src/include/custommem.h b/src/include/custommem.h
index acea9e21..b1645133 100644
--- a/src/include/custommem.h
+++ b/src/include/custommem.h
@@ -34,6 +34,19 @@ int isJumpTableDefault64(void* addr);
 uintptr_t getJumpTable64();
 uintptr_t getJumpTableAddress64(uintptr_t addr);
 uintptr_t getJumpAddress64(uintptr_t addr);
+
+#define JMPTABL_SHIFT3 18
+#define JMPTABL_SHIFT2 18
+#define JMPTABL_SHIFT1 18
+#define JMPTABL_SHIFT0 10
+#define JMPTABL_START3 (JMPTABL_SHIFT0+JMPTABL_SHIFT1+JMPTABL_SHIFT2)
+#define JMPTABL_START2 (JMPTABL_SHIFT0+JMPTABL_SHIFT1)
+#define JMPTABL_START1 (JMPTABL_SHIFT0)
+#define JMPTABL_START0 0
+#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)
 #endif
 
 #define PROT_DYNAREC    0x80