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
68#pragma once
69
70#include <l4/sys/utcb.h>
71#include <l4/sys/types.h>
72#include <l4/sys/rcv_endpoint.h>
73
90
96l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb);
97
109
110
111/* IMPLEMENTATION -----------------------------------------------------------*/
112
113#include <l4/sys/ipc.h>
114
116l4_ipc_gate_bind_thread_u(l4_cap_idx_t gate,
117 l4_cap_idx_t thread, l4_umword_t label,
118 l4_utcb_t *utcb)
119{
120 return l4_rcv_ep_bind_thread_u(gate, thread, label, utcb);
121}
122
124l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb)
125{
126 l4_msgtag_t tag;
127 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
129 tag = l4_ipc_call(gate, utcb, l4_msgtag(L4_PROTO_KOBJECT, 1, 0, 0),
131 if (!l4_msgtag_has_error(tag) && l4_msgtag_label(tag) >= 0)
132 *label = m->mr[0];
133
134 return tag;
135}
136
137
138
140l4_ipc_gate_bind_thread(l4_cap_idx_t gate, l4_cap_idx_t thread,
141 l4_umword_t label)
142{
143 return l4_rcv_ep_bind_thread_u(gate, thread, label, l4_utcb());
144}
145
148{
149 return l4_ipc_gate_get_infos_u(gate, label, l4_utcb());
150}
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:335
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:147
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:439
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:404
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition types.h:416
@ L4_PROTO_KOBJECT
Protocol for messages to a generic kobject.
Definition types.h:51
L4_ipc_gate_ops
Operations on the IPC-gate.
Definition ipc_gate.h:105
@ L4_IPC_GATE_BIND_OP
Bind operation.
Definition ipc_gate.h:106
@ L4_IPC_GATE_GET_INFO_OP
Info operation.
Definition ipc_gate.h:107
#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:153
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