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.

Backports commit 4e51361d79289aee2985dfed472f8d87bd53a8df from qemu
This commit is contained in:
Peter Crosthwaite 2018-02-14 08:49:31 -05:00 committed by Lioncash
parent 6153671333
commit 13b919f5c8
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -215,6 +215,8 @@ extern unsigned long reserved_va;
#define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK) #define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK)
#define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_host_page_mask) #define HOST_PAGE_ALIGN(addr) (((addr) + qemu_host_page_size - 1) & qemu_host_page_mask)
#define REAL_HOST_PAGE_ALIGN(addr) (((addr) + qemu_real_host_page_size - 1) & \
qemu_real_host_page_mask)
/* same as PROT_xxx */ /* same as PROT_xxx */
#define PAGE_READ 0x0001 #define PAGE_READ 0x0001