xref: /qemu/tests/qtest/libqos/malloc-spapr.c (revision 0f9668e0)
11cf4323eSThomas Huth /*
21cf4323eSThomas Huth  * libqos malloc support for SPAPR
31cf4323eSThomas Huth  *
41cf4323eSThomas Huth  * This work is licensed under the terms of the GNU GPL, version 2 or later.
51cf4323eSThomas Huth  * See the COPYING file in the top-level directory.
61cf4323eSThomas Huth  */
71cf4323eSThomas Huth 
81cf4323eSThomas Huth #include "qemu/osdep.h"
9a2ce7dbdSPaolo Bonzini #include "malloc-spapr.h"
101cf4323eSThomas Huth 
11*d2c4f384SJiaxun Yang #define SPAPR_PAGE_SIZE 4096
121cf4323eSThomas Huth 
131cf4323eSThomas Huth /* Memory must be a multiple of 256 MB,
141cf4323eSThomas Huth  * so we have at least 256MB
151cf4323eSThomas Huth  */
161cf4323eSThomas Huth #define SPAPR_MIN_SIZE 0x10000000
171cf4323eSThomas Huth 
spapr_alloc_init(QGuestAllocator * s,QTestState * qts,QAllocOpts flags)181cf4323eSThomas Huth void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
191cf4323eSThomas Huth {
20*d2c4f384SJiaxun Yang     alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, SPAPR_PAGE_SIZE);
211cf4323eSThomas Huth }
22