hw/arm/boot: fix uninitialized scalar variable warning reported by coverity
[qemu/ar7.git] / tests / libqos / malloc.h
blob556538121e0eaa30c7717b31535629846781f8d2
1 /*
2 * libqos malloc support
4 * Copyright IBM, Corp. 2012-2013
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
10 * See the COPYING file in the top-level directory.
13 #ifndef LIBQOS_MALLOC_H
14 #define LIBQOS_MALLOC_H
16 #include <stdint.h>
17 #include <sys/types.h>
19 typedef struct QGuestAllocator QGuestAllocator;
21 struct QGuestAllocator
23 uint64_t (*alloc)(QGuestAllocator *allocator, size_t size);
24 void (*free)(QGuestAllocator *allocator, uint64_t addr);
27 /* Always returns page aligned values */
28 static inline uint64_t guest_alloc(QGuestAllocator *allocator, size_t size)
30 return allocator->alloc(allocator, size);
33 static inline void guest_free(QGuestAllocator *allocator, uint64_t addr)
35 allocator->free(allocator, addr);
38 #endif