1/**
2 * \file
3 * \brief Top-level header for convenient inclusion of standard
4 * libbarrelfish headers.
5 */
6
7/*
8 * Copyright (c) 2007, 2008, 2009, 2010, ETH Zurich.
9 * All rights reserved.
10 *
11 * This file is distributed under the terms in the attached LICENSE file.
12 * If you do not find this file, copies can be found by writing to:
13 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
14 */
15
16#ifndef LIBBARRELFISH_BARRELFISH_H
17#define LIBBARRELFISH_BARRELFISH_H
18
19/* standard libc types and assert */
20#include <stdint.h>
21#include <stddef.h>
22#include <stdbool.h>
23#include <stdlib.h>
24#include <assert.h>
25
26/* utility macros */
27#include <bitmacros.h>
28
29/* barrelfish kernel interface definitions */
30#include <errors/errno.h>
31#include <barrelfish_kpi/types.h>
32#include <barrelfish_kpi/capabilities.h>
33#include <barrelfish_kpi/cpu.h> // XXX!?
34#include <barrelfish_kpi/paging_arch.h>
35#include <barrelfish_kpi/syscalls.h>
36#include <barrelfish_kpi/init.h> // kernel-defined part of cspace
37#include <barrelfish_kpi/registers_arch.h>
38#include <barrelfish_kpi/dispatcher_handle.h>
39
40/* libbarrelfish API */
41#include <barrelfish/types.h>
42#include <barrelfish/capabilities.h>
43#include <barrelfish/slab.h>
44#include <barrelfish/vspace_common.h>
45#include <barrelfish/threads.h>
46#include <barrelfish/slot_alloc.h>
47#include <barrelfish/ram_alloc.h>
48#include <barrelfish/syscalls.h>
49#include <barrelfish/cspace.h>
50#include <barrelfish/domain.h>
51#include <barrelfish/debug.h>
52#include <barrelfish/static_assert.h>
53
54/* XXX: utility macros. not sure where to put these */
55
56/* Duplicate memory */
57static inline void * memdup(const void *ptr, size_t size) {
58    void *res = malloc(size);
59    assert(res);
60    memcpy(res, ptr, size);
61    return res;
62}
63
64/* XXX: glue junk for old IDC system, to be removed!! */
65
66void messages_wait_and_handle_next(void);
67void __attribute__((noreturn)) messages_handler_loop(void);
68
69typedef void *CONST_CAST;
70
71#endif
72