pc: acpi: consolidate CPU hotplug AML
[qemu/ar7.git] / tests / libqos / malloc-generic.c
blob6000df2b8231af4da2696291c8db4d3b6f5d9cd0
1 /*
2 * Basic libqos generic malloc support
4 * Copyright (c) 2014 Marc MarĂ­
6 * This work is licensed under the terms of the GNU GPL, version 2 or later.
7 * See the COPYING file in the top-level directory.
8 */
10 #include "qemu/osdep.h"
11 #include <glib.h>
12 #include "libqos/malloc-generic.h"
13 #include "libqos/malloc.h"
16 * Mostly for valgrind happiness, but it does offer
17 * a chokepoint for debugging guest memory leaks, too.
19 void generic_alloc_uninit(QGuestAllocator *allocator)
21 alloc_uninit(allocator);
24 QGuestAllocator *generic_alloc_init_flags(uint64_t base_addr, uint64_t size,
25 uint32_t page_size, QAllocOpts flags)
27 QGuestAllocator *s;
28 uint64_t start = base_addr + (1 << 20); /* Start at 1MB */
30 s = alloc_init_flags(flags, start, start + size);
31 alloc_set_page_size(s, page_size);
33 return s;
36 inline QGuestAllocator *generic_alloc_init(uint64_t base_addr, uint64_t size,
37 uint32_t page_size)
39 return generic_alloc_init_flags(base_addr, size, page_size, ALLOC_NO_FLAGS);