softmmu: Introduce qemu_target_page_mask() helper
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 24 May 2023 09:37:35 +0000 (11:37 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 23 Jun 2023 06:54:44 +0000 (02:54 -0400)
Since TARGET_PAGE_MASK is poisoned in target-agnostic code,
introduce the qemu_target_page_mask() helper to get this
value from target-agnostic code at runtime.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230524093744.88442-2-philmd@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
include/exec/target_page.h
softmmu/physmem.c

index bbf37aea177879981e2458d7e00ee3a5a3f46e46..98ffbb5c2396f97d2d3cc06c915f6daa170a75ed 100644 (file)
@@ -15,6 +15,7 @@
 #define EXEC_TARGET_PAGE_H
 
 size_t qemu_target_page_size(void);
+int qemu_target_page_mask(void);
 int qemu_target_page_bits(void);
 int qemu_target_page_bits_min(void);
 
index 6bdd944fe8806cd00d340f0b66a5bee788dc6fcc..bda475a719d5d4db3b5773bc12b1c95287bad345 100644 (file)
@@ -3359,6 +3359,11 @@ size_t qemu_target_page_size(void)
     return TARGET_PAGE_SIZE;
 }
 
+int qemu_target_page_mask(void)
+{
+    return TARGET_PAGE_MASK;
+}
+
 int qemu_target_page_bits(void)
 {
     return TARGET_PAGE_BITS;