tcg/aarch64: implement byte swap operations
[qemu/ar7.git] / tests / libqos / malloc.h
blob46f6000763af41cc1cecc28b7fba14b5a750c9cc
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->alloc(allocator, addr);
38 #endif