aboutsummaryrefslogtreecommitdiff
path: root/translate-all.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <crosthwaitepeter@gmail.com>2015-07-06 12:15:12 -0600
committerAlex Williamson <alex.williamson@redhat.com>2015-07-06 12:15:12 -0600
commit4e51361d79289aee2985dfed472f8d87bd53a8df (patch)
treec5c260b1336f6ba9d7f2dfc1ab927df30e40a6ce /translate-all.c
parent7d489dcdf5fd71b5052ffd401b869a627e1c751f (diff)
downloadqemu-4e51361d79289aee2985dfed472f8d87bd53a8df.zip
qemu-4e51361d79289aee2985dfed472f8d87bd53a8df.tar.gz
qemu-4e51361d79289aee2985dfed472f8d87bd53a8df.tar.bz2
cpu-all: complete "real" host page size API
Currently the "host" page size alignment API is really aligning to both host and target page sizes. There is the qemu_real_page_size which can be used for the actual host page size but it's missing a mask and ALIGN macro as provided for qemu_page_size. Complete the API. This allows system level code that cares about the host page size to use a consistent alignment interface without having to un-needingly align to the target page size. This also reduces system level code dependency on the cpu specific TARGET_PAGE_SIZE. Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'translate-all.c')
-rw-r--r--translate-all.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/translate-all.c b/translate-all.c
index 412bc90..50d53fd 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -118,6 +118,7 @@ typedef struct PageDesc {
#define V_L1_SHIFT (L1_MAP_ADDR_SPACE_BITS - TARGET_PAGE_BITS - V_L1_BITS)
uintptr_t qemu_real_host_page_size;
+uintptr_t qemu_real_host_page_mask;
uintptr_t qemu_host_page_size;
uintptr_t qemu_host_page_mask;
@@ -307,6 +308,7 @@ void page_size_init(void)
/* NOTE: we can always suppose that qemu_host_page_size >=
TARGET_PAGE_SIZE */
qemu_real_host_page_size = getpagesize();
+ qemu_real_host_page_mask = ~(qemu_real_host_page_size - 1);
if (qemu_host_page_size == 0) {
qemu_host_page_size = qemu_real_host_page_size;
}