1/**
2 * \file
3 */
4
5/*
6 * Copyright (c) 2009, ETH Zurich.
7 * All rights reserved.
8 *
9 * This file is distributed under the terms in the attached LICENSE file.
10 * If you do not find this file, copies can be found by writing to:
11 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
12 */
13
14#ifndef VMKITMON_H
15#define VMKITMON_H
16
17#include <barrelfish/barrelfish.h>
18#include <barrelfish_kpi/vmkit.h>
19#include "guest.h"
20
21// Globals
22extern void *       grub_image;
23extern size_t       grub_image_size;
24extern void *       hdd0_image;
25extern size_t       hdd0_image_size;
26extern struct guest *guest;
27
28// Handler return values - this does probably not belong here
29#define HANDLER_ERR_OK              (0)
30#define HANDLER_ERR_FATAL           (-1)
31#define HANDLER_ERR_UNHANDELED      (-2)
32
33#define assert_err(e,m)     \
34do {                        \
35    if (err_is_fail(e)) {   \
36        DEBUG_ERR(e,m);     \
37        abort();            \
38    }                       \
39} while (0)
40
41#define LIKELY(x)       __builtin_expect((x),1)
42#define UNLIKELY(x)     __builtin_expect((x),0)
43
44//#define VMKIT_PCI_DEBUG_SWITCH
45
46#if defined(VMKIT_PCI_DEBUG_SWITCH)
47#define VMKIT_PCI_DEBUG(x...) printf("VMKit PCI: " x)
48#else
49#define VMKIT_PCI_DEBUG(x...) ((void)0)
50#endif
51
52#endif // VMKITMON_H
53