summaryrefslogtreecommitdiff
path: root/include/exec/tb-hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/exec/tb-hash.h')
-rw-r--r--include/exec/tb-hash.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/exec/tb-hash.h b/include/exec/tb-hash.h
index e0bd786f9f..0f4e8a08af 100644
--- a/include/exec/tb-hash.h
+++ b/include/exec/tb-hash.h
@@ -20,6 +20,14 @@
#ifndef EXEC_TB_HASH
#define EXEC_TB_HASH
+/* Only the bottom TB_JMP_PAGE_BITS of the jump cache hash bits vary for
+ addresses on the same page. The top bits are the same. This allows
+ TLB invalidation to quickly clear a subset of the hash table. */
+#define TB_JMP_PAGE_BITS (TB_JMP_CACHE_BITS / 2)
+#define TB_JMP_PAGE_SIZE (1 << TB_JMP_PAGE_BITS)
+#define TB_JMP_ADDR_MASK (TB_JMP_PAGE_SIZE - 1)
+#define TB_JMP_PAGE_MASK (TB_JMP_CACHE_SIZE - TB_JMP_PAGE_SIZE)
+
static inline unsigned int tb_jmp_cache_hash_page(target_ulong pc)
{
target_ulong tmp;