L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
ipc_helper
Go to the documentation of this file.
1// vi:set ft=cpp: -*- Mode: C++ -*-
6/*
7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
8 * Alexander Warg <warg@os.inf.tu-dresden.de>
9 * economic rights: Technische Universität Dresden (Germany)
10 *
11 * This file is part of TUD:OS and distributed under the terms of the
12 * GNU General Public License 2.
13 * Please see the COPYING-GPL-2 file for details.
14 *
15 * As a special exception, you may use this file as part of a free software
16 * library without restriction. Specifically, if other files instantiate
17 * templates or use macros or inline functions from this file, or you compile
18 * this file and link it with other files to produce an executable, this
19 * file does not by itself cause the resulting executable to be covered by
20 * the GNU General Public License. This exception does not however
21 * invalidate any other reasons why the executable file might be covered by
22 * the GNU General Public License.
23 */
24#pragma once
25
26#include <l4/cxx/exceptions>
27#include <l4/sys/utcb.h>
28
33namespace L4
34{
35#ifdef __EXCEPTIONS
44 inline void
45 throw_ipc_exception([[maybe_unused]] L4::Cap<void> const &o,
46 l4_msgtag_t const &err, l4_utcb_t *utcb)
47 {
48 if (err.has_error())
49 throw (L4::Com_error(l4_error_u(err, utcb)));
50 }
51
60 inline void
61 throw_ipc_exception(void const *o, l4_msgtag_t const &err,
62 l4_utcb_t *utcb)
63 { throw_ipc_exception(L4::Cap<void>(o), err, utcb); }
64#endif
65
66}
C++ interface for capabilities.
Definition capability.h:219
Error conditions during IPC.
Definition exceptions:275
Base exceptions.
void throw_ipc_exception(L4::Cap< void > const &o, l4_msgtag_t const &err, l4_utcb_t *utcb)
Throw an L4 IPC error as exception.
Definition ipc_helper:45
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:67
L4 low-level kernel interface.
Definition io_regblock.h:19
Message tag data structure.
Definition types.h:164
unsigned has_error() const L4_NOTHROW
Test if flags indicate an error.
Definition types.h:195