summary refs log tree commit diff stats
path: root/contrib/elf2dmp/addrspace.c
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2021-01-18 14:38:04 +0800
committerThomas Huth <thuth@redhat.com>2021-01-20 10:46:54 +0100
commit2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0 (patch)
tree313e29b9646e6e324be3b280dab8ef9a767ea422 /contrib/elf2dmp/addrspace.c
parent9c57272507a95cde3c9c2c90af2312f92cb55422 (diff)
downloadfocaccia-qemu-2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0.tar.gz
focaccia-qemu-2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0.zip
elf2dmp: Rename PAGE_SIZE to ELF2DMP_PAGE_SIZE
As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

To prevent collosion of definition, we rename PAGE_SIZE here.

[1]: https://pubs.opengroup.org/onlinepubs/7908799/xsh/limits.h.html

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210118063808.12471-6-jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'contrib/elf2dmp/addrspace.c')
-rw-r--r--contrib/elf2dmp/addrspace.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/elf2dmp/addrspace.c b/contrib/elf2dmp/addrspace.c
index 8a76069cb5..53ded17061 100644
--- a/contrib/elf2dmp/addrspace.c
+++ b/contrib/elf2dmp/addrspace.c
@@ -207,8 +207,8 @@ int va_space_rw(struct va_space *vs, uint64_t addr,
         void *buf, size_t size, int is_write)
 {
     while (size) {
-        uint64_t page = addr & PFN_MASK;
-        size_t s = (page + PAGE_SIZE) - addr;
+        uint64_t page = addr & ELF2DMP_PFN_MASK;
+        size_t s = (page + ELF2DMP_PAGE_SIZE) - addr;
         void *ptr;
 
         s = (s > size) ? size : s;