L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 * License: see LICENSE.spdx (in this directory or the directories above)
7 */
8
72#pragma once
73
74#include <l4/sys/utcb.h>
75#include <l4/sys/types.h>
76#include <l4/sys/rcv_endpoint.h>
77
94
100l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb);
101
113
114
115/* IMPLEMENTATION -----------------------------------------------------------*/
116
117#include <l4/sys/ipc.h>
118
120l4_ipc_gate_bind_thread_u(l4_cap_idx_t gate,
121 l4_cap_idx_t thread, l4_umword_t label,
122 l4_utcb_t *utcb)
123{
124 return l4_rcv_ep_bind_thread_u(gate, thread, label, utcb);
125}
126
128l4_ipc_gate_bind_snd_destination_u(l4_cap_idx_t gate,
129 l4_cap_idx_t snd_dst, l4_umword_t label,
130 l4_utcb_t *utcb)
131{
132 return l4_rcv_ep_bind_snd_destination_u(gate, snd_dst, 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
159l4_ipc_gate_bind_snd_destination(l4_cap_idx_t gate, l4_cap_idx_t snd_dst,
160 l4_umword_t label)
161{
162 return l4_rcv_ep_bind_snd_destination_u(gate, snd_dst, label, l4_utcb());
163}
164
167{
168 return l4_ipc_gate_get_infos_u(gate, label, l4_utcb());
169}
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
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:565
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:166
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:440
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:405
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition types.h:417
@ L4_PROTO_KOBJECT
Protocol for messages to a generic kobject.
Definition types.h:52
L4_ipc_gate_ops
Operations on the IPC-gate.
Definition ipc_gate.h:109
@ L4_IPC_GATE_BIND_OP
Bind operation.
Definition ipc_gate.h:110
@ L4_IPC_GATE_GET_INFO_OP
Info operation.
Definition ipc_gate.h:111
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:76
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Common L4 ABI Data Types.
Receive endpoint C interface.
Message tag data structure.
Definition types.h:154
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:68
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:69