1// vi:set ft=cpp: -*- Mode: C++ -*-
2/*
3 * (c) 2014 Alexander Warg <alexander.warg@kernkonzept.com>
4 *
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
8 *
9 * As a special exception, you may use this file as part of a free software
10 * library without restriction.  Specifically, if other files instantiate
11 * templates or use macros or inline functions from this file, or you compile
12 * this file and link it with other files to produce an executable, this
13 * file does not by itself cause the resulting executable to be covered by
14 * the GNU General Public License.  This exception does not however
15 * invalidate any other reasons why the executable file might be covered by
16 * the GNU General Public License.
17 */
18#pragma once
19#pragma GCC system_header
20
21#include <l4/sys/cxx/ipc_basics>
22#include <l4/sys/cxx/ipc_types>
23#include <l4/sys/cxx/ipc_iface>
24#include <l4/sys/__typeinfo.h>
25#include <l4/sys/err.h>
26
27/**
28 * \file
29 */
30
31namespace L4 { namespace Ipc { namespace Msg {
32//-------------------------------------------------------------------------
33
34/**
35 * Generate the definition of an RPC stub.
36 *
37 * \param name  The fully qualified method name to be implemented, this means
38 *              `class::method`.
39 *
40 * This macro generates the definition (implementation) for the given RPC
41 * interface method.
42 */
43#define L4_RPC_DEF(name) \
44  template struct  L4::Ipc::Msg::Rpc_call \
45    <name##_t, name##_t::class_type, name##_t::ipc_type, name##_t::flags_type>
46
47
48/// \cond
49//----------------------------------------------------
50//Implementation of the RPC call
51template<typename OP, typename C, typename FLAGS, typename R, typename ...ARGS>
52R L4_EXPORT
53Rpc_call<OP, C, R (ARGS...), FLAGS>::
54  call(L4::Cap<C> cap, typename _Elem<ARGS>::arg_type ...a, l4_utcb_t *utcb) noexcept
55{
56  return Rpc_inline_call<OP, C, R (ARGS...), FLAGS>::call(cap, a..., utcb);
57}
58/// \endcond
59
60} // namespace Msg
61} // namespace Ipc
62} // namespace L4
63
64