]> Git Repo - qemu.git/blame - tests/libqos/malloc.h
libqos: Use explicit QTestState for i2c operations
[qemu.git] / tests / libqos / malloc.h
CommitLineData
8a0743cf
AL
1/*
2 * libqos malloc support
3 *
4 * Copyright IBM, Corp. 2012-2013
5 *
6 * Authors:
7 * Anthony Liguori <[email protected]>
8 *
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.
11 */
12
13#ifndef LIBQOS_MALLOC_H
14#define LIBQOS_MALLOC_H
15
292be092 16#include "qemu/queue.h"
05e520f1 17#include "libqtest.h"
8a0743cf 18
292be092
MM
19typedef enum {
20 ALLOC_NO_FLAGS = 0x00,
21 ALLOC_LEAK_WARN = 0x01,
22 ALLOC_LEAK_ASSERT = 0x02,
23 ALLOC_PARANOID = 0x04
24} QAllocOpts;
25
f6f363c1 26typedef struct QGuestAllocator QGuestAllocator;
292be092 27
292be092 28void alloc_uninit(QGuestAllocator *allocator);
8a0743cf
AL
29
30/* Always returns page aligned values */
292be092
MM
31uint64_t guest_alloc(QGuestAllocator *allocator, size_t size);
32void guest_free(QGuestAllocator *allocator, uint64_t addr);
085248ae 33void migrate_allocator(QGuestAllocator *src, QGuestAllocator *dst);
8a0743cf 34
af77f2cd 35QGuestAllocator *alloc_init(uint64_t start, uint64_t end);
fa02e608
JS
36QGuestAllocator *alloc_init_flags(QAllocOpts flags,
37 uint64_t start, uint64_t end);
f6f363c1 38void alloc_set_page_size(QGuestAllocator *allocator, size_t page_size);
259342d3 39void alloc_set_flags(QGuestAllocator *allocator, QAllocOpts opts);
f6f363c1 40
8a0743cf 41#endif
This page took 0.247628 seconds and 4 git commands to generate.