summary refs log tree commit diff stats
path: root/tests/qtest/libqos/malloc-pc.c
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2021-01-18 14:38:05 +0800
committerThomas Huth <thuth@redhat.com>2021-01-20 10:46:54 +0100
commitd2c4f3841d1cba17c99f76812ffcb75a6c402202 (patch)
tree338680b9d8a259330839568b545d8bca0b04d0ec /tests/qtest/libqos/malloc-pc.c
parent2d0fc797faaa73fbc1d30f5f9e90407bf3dd93f0 (diff)
downloadfocaccia-qemu-d2c4f3841d1cba17c99f76812ffcb75a6c402202.tar.gz
focaccia-qemu-d2c4f3841d1cba17c99f76812ffcb75a6c402202.zip
tests: Rename PAGE_SIZE definitions
As per POSIX specification of limits.h [1], OS libc may define
PAGE_SIZE in limits.h.

Self defined PAGE_SIZE is frequently used in tests, to prevent
collosion of definition, we give PAGE_SIZE definitons reasonable
prefixs.

[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-7-jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/qtest/libqos/malloc-pc.c')
-rw-r--r--tests/qtest/libqos/malloc-pc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qtest/libqos/malloc-pc.c b/tests/qtest/libqos/malloc-pc.c
index 16ff9609cc..f1e3b392a5 100644
--- a/tests/qtest/libqos/malloc-pc.c
+++ b/tests/qtest/libqos/malloc-pc.c
@@ -18,7 +18,7 @@
 
 #include "qemu-common.h"
 
-#define PAGE_SIZE (4096)
+#define ALLOC_PAGE_SIZE (4096)
 
 void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
 {
@@ -26,7 +26,7 @@ void pc_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
     QFWCFG *fw_cfg = pc_fw_cfg_init(qts);
 
     ram_size = qfw_cfg_get_u64(fw_cfg, FW_CFG_RAM_SIZE);
-    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), PAGE_SIZE);
+    alloc_init(s, flags, 1 << 20, MIN(ram_size, 0xE0000000), ALLOC_PAGE_SIZE);
 
     /* clean-up */
     pc_fw_cfg_uninit(fw_cfg);