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, Universitaetstrasse 6, 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#include <sys/cdefs.h> 27 28/* utility macros */ 29#include <bitmacros.h> 30 31/* barrelfish kernel interface definitions */ 32#include <errors/errno.h> 33#include <barrelfish_kpi/types.h> 34#include <barrelfish_kpi/capabilities.h> 35#include <barrelfish_kpi/cpu.h> // XXX!? 36#include <barrelfish_kpi/paging_arch.h> 37#include <barrelfish_kpi/syscalls.h> 38#include <barrelfish_kpi/init.h> // kernel-defined part of cspace 39#include <barrelfish_kpi/registers_arch.h> 40#include <barrelfish_kpi/dispatcher_handle.h> 41 42/* libbarrelfish API */ 43#include <barrelfish/types.h> 44#include <barrelfish/capabilities.h> 45#include <barrelfish/slab.h> 46#include <barrelfish/vspace_common.h> 47#include <barrelfish/threads.h> 48#include <barrelfish/slot_alloc.h> 49#include <barrelfish/ram_alloc.h> 50#include <barrelfish/syscalls.h> 51#include <barrelfish/cspace.h> 52#include <barrelfish/domain.h> 53#include <barrelfish/debug.h> 54#include <barrelfish/static_assert.h> 55 56/* XXX: utility macros. not sure where to put these */ 57 58__BEGIN_DECLS 59 60/* Duplicate memory */ 61static inline void * memdup(const void *ptr, size_t size) { 62 void *res = malloc(size); 63 assert(res); 64 memcpy(res, ptr, size); 65 return res; 66} 67 68 69typedef void *CONST_CAST; 70 71__END_DECLS 72 73#endif 74