1/**
2 * \file
3 */
4
5/*
6 * Copyright (c) 2009, 2013, 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 <stdio.h> // printf()
20#include "guest.h"
21
22// Handler return values - this does probably not belong here
23#define HANDLER_ERR_OK              (0)
24#define HANDLER_ERR_FATAL           (-1)
25#define HANDLER_ERR_UNHANDELED      (-2)
26
27#define assert_err(e,m)     \
28do {                        \
29    if (err_is_fail(e)) {   \
30        DEBUG_ERR(e,m);     \
31        abort();            \
32    }                       \
33} while (0)
34
35#define LIKELY(x)       __builtin_expect((x),1)
36#define UNLIKELY(x)     __builtin_expect((x),0)
37
38#if defined(VMKIT_PCI_DEBUG_SWITCH)
39#define VMKIT_PCI_DEBUG(x...) printf("VMKit PCI: " x)
40#else
41#define VMKIT_PCI_DEBUG(x...) ((void)0)
42#endif
43
44#endif // VMKITMON_H
45