Loading...
Searching...
No Matches
ipc_gate.h
Go to the documentation of this file.
/*
* (c) 2009-2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/utcb.h>
#include <l4/sys/types.h>
#include <l4/sys/rcv_endpoint.h>
L4_INLINE l4_msgtag_t
l4_ipc_gate_get_infos(l4_cap_idx_t gate, l4_umword_t *label);
L4_INLINE l4_msgtag_t
l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb);
enum L4_ipc_gate_ops
{
L4_IPC_GATE_BIND_OP = 0x10,
L4_IPC_GATE_GET_INFO_OP = 0x11,
};
/* IMPLEMENTATION -----------------------------------------------------------*/
#include <l4/sys/ipc.h>
L4_INLINE l4_msgtag_t
l4_ipc_gate_bind_thread_u(l4_cap_idx_t gate,
l4_cap_idx_t thread, l4_umword_t label,
l4_utcb_t *utcb)
{
return l4_rcv_ep_bind_thread_u(gate, thread, label, utcb);
}
L4_INLINE l4_msgtag_t
l4_ipc_gate_bind_snd_destination_u(l4_cap_idx_t gate,
l4_cap_idx_t snd_dst, l4_umword_t label,
l4_utcb_t *utcb)
{
return l4_rcv_ep_bind_snd_destination_u(gate, snd_dst, label, utcb);
}
L4_INLINE l4_msgtag_t
l4_ipc_gate_get_infos_u(l4_cap_idx_t gate, l4_umword_t *label, l4_utcb_t *utcb)
{
l4_msgtag_t tag;
l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
m->mr[0] = L4_IPC_GATE_GET_INFO_OP;
tag = l4_ipc_call(gate, utcb, l4_msgtag(L4_PROTO_KOBJECT, 1, 0, 0),
L4_IPC_NEVER);
if (!l4_msgtag_has_error(tag) && l4_msgtag_label(tag) >= 0)
*label = m->mr[0];
return tag;
}
L4_INLINE l4_msgtag_t
l4_ipc_gate_bind_thread(l4_cap_idx_t gate, l4_cap_idx_t thread,
l4_umword_t label)
{
return l4_rcv_ep_bind_thread_u(gate, thread, label, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_ipc_gate_bind_snd_destination(l4_cap_idx_t gate, l4_cap_idx_t snd_dst,
l4_umword_t label)
{
return l4_rcv_ep_bind_snd_destination_u(gate, snd_dst, label, l4_utcb());
}
L4_INLINE l4_msgtag_t
l4_ipc_gate_get_infos(l4_cap_idx_t gate, l4_umword_t *label)
{
return l4_ipc_gate_get_infos_u(gate, label, l4_utcb());
}
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
l4_ipc_call
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_ipc_gate_get_infos
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
l4_msgtag_has_error
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:440
l4_msgtag
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
l4_msgtag_label
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition types.h:417
L4_PROTO_KOBJECT
@ L4_PROTO_KOBJECT
Protocol for messages to a generic kobject.
Definition types.h:52
L4_ipc_gate_ops
L4_ipc_gate_ops
Operations on the IPC-gate.
Definition ipc_gate.h:109
L4_IPC_GATE_BIND_OP
@ L4_IPC_GATE_BIND_OP
Bind operation.
Definition ipc_gate.h:110
L4_IPC_GATE_GET_INFO_OP
@ L4_IPC_GATE_GET_INFO_OP
Info operation.
Definition ipc_gate.h:111
L4_IPC_NEVER
#define L4_IPC_NEVER
never timeout
Definition __timeout.h:76
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
ipc.h
Common IPC interface.
types.h
Common L4 ABI Data Types.
utcb.h
UTCB definitions.
rcv_endpoint.h
Receive endpoint C interface.
l4_msgtag_t
Message tag data structure.
Definition types.h:154
l4_msg_regs_t
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:68
l4_msg_regs_t::mr
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:69