diff mbox series

[PULL,13/53] softmmu: Introduce qemu_target_page_mask() helper

Message ID b3b408ffb9291e887029051a522a2c968a816d22.1687782442.git.mst@redhat.com
State Accepted
Commit b3b408ffb9291e887029051a522a2c968a816d22
Headers show
Series None | expand

Commit Message

Michael S. Tsirkin June 26, 2023, 12:28 p.m. UTC
From: Philippe Mathieu-Daudé <philmd@linaro.org>

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 | 1 +
 softmmu/physmem.c          | 5 +++++
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/include/exec/target_page.h b/include/exec/target_page.h
index bbf37aea17..98ffbb5c23 100644
--- a/include/exec/target_page.h
+++ b/include/exec/target_page.h
@@ -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);
 
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 6bdd944fe8..bda475a719 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -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;