L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
rcv_endpoint.h
Go to the documentation of this file.
1
5/*
6 * (c) 2017 Alexander Warg <alexander.warg@kernkonzept.com>
7 *
8 * License: see LICENSE.spdx (in this directory or the directories above)
9 */
10#pragma once
11
12#include <l4/sys/utcb.h>
13#include <l4/sys/types.h>
14
47 l4_umword_t label);
48
78 l4_umword_t label);
79
85l4_rcv_ep_bind_thread_u(l4_cap_idx_t ep, l4_cap_idx_t thread,
86 l4_umword_t label, l4_utcb_t *utcb);
87
89l4_rcv_ep_bind_snd_destination_u(l4_cap_idx_t ep, l4_cap_idx_t snd_dst,
90 l4_umword_t label, l4_utcb_t *utcb);
91
94{
96};
97
98/* IMPLEMENTATION -----------------------------------------------------------*/
99
100#include <l4/sys/ipc.h>
101
103l4_rcv_ep_bind_thread_u(l4_cap_idx_t ep,
104 l4_cap_idx_t thread, l4_umword_t label,
105 l4_utcb_t *utcb)
106{
107 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
108 m->mr[0] = L4_RCV_EP_BIND_OP;
109 m->mr[1] = label;
110 m->mr[2] = l4_map_obj_control(0, 0);
111 m->mr[3] = l4_obj_fpage(thread, 0, L4_CAP_FPAGE_RWS).raw;
112 return l4_ipc_call(ep, utcb, l4_msgtag(L4_PROTO_KOBJECT, 2, 1, 0),
114}
115
117l4_rcv_ep_bind_snd_destination_u(l4_cap_idx_t ep,
118 l4_cap_idx_t snd_dst, l4_umword_t label,
119 l4_utcb_t *utcb)
120{
121 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
122 m->mr[0] = L4_RCV_EP_BIND_OP;
123 m->mr[1] = label;
124 m->mr[2] = l4_map_obj_control(0, 0);
125 m->mr[3] = l4_obj_fpage(snd_dst, 0, L4_CAP_FPAGE_RWS).raw;
126 return l4_ipc_call(ep, utcb, l4_msgtag(L4_PROTO_KOBJECT, 2, 1, 0),
128}
129
132 l4_umword_t label)
133{
134 return l4_rcv_ep_bind_thread_u(ep, thread, label, l4_utcb());
135}
136
139 l4_umword_t label)
140{
141 return l4_rcv_ep_bind_snd_destination_u(ep, snd_dst, label, l4_utcb());
142}
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_fpage_t l4_obj_fpage(l4_cap_idx_t obj, unsigned int order, unsigned char rights) L4_NOTHROW
Create a kernel-object flexpage.
Definition __l4_fpage.h:715
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flexpages.
Definition __l4_fpage.h:206
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_rcv_ep_bind_thread(l4_cap_idx_t ep, l4_cap_idx_t thread, l4_umword_t label)
Bind the IPC receive endpoint to a thread.
l4_msgtag_t l4_rcv_ep_bind_snd_destination(l4_cap_idx_t ep, l4_cap_idx_t snd_dst, l4_umword_t label)
Bind the IPC receive endpoint to a send destination (a thread).
l4_umword_t l4_map_obj_control(l4_umword_t spot, unsigned grant) L4_NOTHROW
Create the first word for a map item that is a send item for the object space.
Definition __l4_fpage.h:749
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_PROTO_KOBJECT
Protocol for messages to a generic kobject.
Definition types.h:52
#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 IPC interface.
Common L4 ABI Data Types.
UTCB definitions.
L4_rcv_ep_ops
Receive endpoint operations.
@ L4_RCV_EP_BIND_OP
Bind to thread or thread group.
Message tag data structure.
Definition types.h:154
l4_umword_t raw
Raw value.
Definition __l4_fpage.h:78
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