L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
ipc_gate.h
Go to the documentation of this file.
1/*
2 * (c) 2009-2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
5 *
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
9 *
10 * As a special exception, you may use this file as part of a free software
11 * library without restriction. Specifically, if other files instantiate
12 * templates or use macros or inline functions from this file, or you compile
13 * this file and link it with other files to produce an executable, this
14 * file does not by itself cause the resulting executable to be covered by
15 * the GNU General Public License. This exception does not however
16 * invalidate any other reasons why the executable file might be covered by
17 * the GNU General Public License.
18 */
19
80#pragma once
81
82#include <l4/sys/utcb.h>
83#include <l4/sys/types.h>
84#include <l4/sys/rcv_endpoint.h>
85
102
108l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb);
109
121
122
123/* IMPLEMENTATION -----------------------------------------------------------*/
124
125#include <l4/sys/ipc.h>
126
128l4_ipc_gate_bind_thread_u(l4_cap_idx_t gate,
129 l4_cap_idx_t thread, l4_umword_t label,
130 l4_utcb_t *utcb)
131{
132 return l4_rcv_ep_bind_thread_u(gate, thread, label, utcb);
133}
134
136l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb)
137{
138 l4_msgtag_t tag;
139 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
141 tag = l4_ipc_call(gate, utcb, l4_msgtag(L4_PROTO_KOBJECT, 1, 0, 0),
143 if (!l4_msgtag_has_error(tag) && l4_msgtag_label(tag) >= 0)
144 *label = m->mr[0];
145
146 return tag;
147}
148
149
150
152l4_ipc_gate_bind_thread(l4_cap_idx_t gate, l4_cap_idx_t thread,
153 l4_umword_t label)
154{
155 return l4_rcv_ep_bind_thread_u(gate, thread, label, l4_utcb());
156}
157
160{
161 return l4_ipc_gate_get_infos_u(gate, label, l4_utcb());
162}
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:51
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:358
l4_msgtag_t l4_ipc_call(l4_cap_idx_t object, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Object call (usual invocation).
Definition ipc.h:550
l4_msgtag_t l4_ipc_gate_get_infos(l4_cap_idx_t gate, l4_umword_t *label)
Get information about the IPC-gate.
Definition ipc_gate.h:159
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:456
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
Definition types.h:427
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition types.h:439
@ L4_PROTO_KOBJECT
Protocol for messages to a generic kobject.
Definition types.h:62
L4_ipc_gate_ops
Operations on the IPC-gate.
Definition ipc_gate.h:117
@ L4_IPC_GATE_BIND_OP
Bind operation.
Definition ipc_gate.h:118
@ L4_IPC_GATE_GET_INFO_OP
Info operation.
Definition ipc_gate.h:119
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:82
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:67
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:340
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:62
Common L4 ABI Data Types.
Receive endpoint C interface.
Message tag data structure.
Definition types.h:163
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:79
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:80