xref: /openbmc/qemu/tests/qtest/libqos/malloc-spapr.c (revision 1cf4323e)
1*1cf4323eSThomas Huth /*
2*1cf4323eSThomas Huth  * libqos malloc support for SPAPR
3*1cf4323eSThomas Huth  *
4*1cf4323eSThomas Huth  * This work is licensed under the terms of the GNU GPL, version 2 or later.
5*1cf4323eSThomas Huth  * See the COPYING file in the top-level directory.
6*1cf4323eSThomas Huth  */
7*1cf4323eSThomas Huth 
8*1cf4323eSThomas Huth #include "qemu/osdep.h"
9*1cf4323eSThomas Huth #include "libqos/malloc-spapr.h"
10*1cf4323eSThomas Huth 
11*1cf4323eSThomas Huth #include "qemu-common.h"
12*1cf4323eSThomas Huth 
13*1cf4323eSThomas Huth #define PAGE_SIZE 4096
14*1cf4323eSThomas Huth 
15*1cf4323eSThomas Huth /* Memory must be a multiple of 256 MB,
16*1cf4323eSThomas Huth  * so we have at least 256MB
17*1cf4323eSThomas Huth  */
18*1cf4323eSThomas Huth #define SPAPR_MIN_SIZE 0x10000000
19*1cf4323eSThomas Huth 
20*1cf4323eSThomas Huth void spapr_alloc_init(QGuestAllocator *s, QTestState *qts, QAllocOpts flags)
21*1cf4323eSThomas Huth {
22*1cf4323eSThomas Huth     alloc_init(s, flags, 1 << 20, SPAPR_MIN_SIZE, PAGE_SIZE);
23*1cf4323eSThomas Huth }
24