L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
thread_group.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022-2025 Kernkonzept GmbH.
3 * Author(s): Adam Lackorzynski <adam@os.inf.tu-dresden.de>
4 * Frank Mehnert <frank.mehnert@kernkonzept.com>
5 *
6 * License: see LICENSE.spdx (in this directory or the directories above)
7 */
11#pragma once
12
13#include <l4/sys/types.h>
14#include <l4/sys/utcb.h>
15
33
45
66
76
81l4_thread_group_add_u(l4_cap_idx_t tg,
82 l4_cap_idx_t thread,
83 l4_utcb_t *utcb) L4_NOTHROW;
84
94
99l4_thread_group_remove_u(l4_cap_idx_t tg,
100 l4_cap_idx_t thread,
101 l4_utcb_t *utcb) L4_NOTHROW;
102
103
104/* IMPLEMENTATION -----------------------------------------------------------*/
105
106#include <l4/sys/ipc.h>
107
109l4_thread_group_add_u(l4_cap_idx_t tg,
110 l4_cap_idx_t thread,
111 l4_utcb_t *utcb) L4_NOTHROW
112{
113 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
115 v->mr[1] = l4_map_obj_control(0, 0);
116 v->mr[2] = l4_obj_fpage(thread, 0, L4_CAP_FPAGE_RWS).raw;
117 return l4_ipc_call(tg, utcb,
119}
120
122l4_thread_group_remove_u(l4_cap_idx_t tg,
123 l4_cap_idx_t thread,
124 l4_utcb_t *utcb) L4_NOTHROW
125{
126 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
128 v->mr[1] = l4_map_obj_control(0, 0);
129 v->mr[2] = l4_obj_fpage(thread, 0, L4_CAP_FPAGE_RWS).raw;
130 return l4_ipc_call(tg, utcb,
132}
133
137{
138 return l4_thread_group_add_u(tg, thread, l4_utcb());
139}
140
144{
145 return l4_thread_group_remove_u(tg, thread, l4_utcb());
146}
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:372
L4_CONSTEXPR 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:731
@ 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:598
L4_CONSTEXPR 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:765
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:441
@ L4_PROTO_THREAD_GROUP
Protocol for messages to a thread group obj.
Definition types.h:67
L4_thread_group_policy
Thread group policy.
l4_msgtag_t l4_thread_group_remove(l4_cap_idx_t tg, l4_cap_idx_t thread) L4_NOTHROW
Remove thread from a thread group.
l4_msgtag_t l4_thread_group_add(l4_cap_idx_t tg, l4_cap_idx_t thread) L4_NOTHROW
Add thread to a thread group.
L4_thread_group_ops
Operations on the Thread_group object.
@ L4_THREAD_GROUP_POLICY_SOFT_CORE_LOCAL
Prefer a thread on the same CPU core.
@ L4_THREAD_GROUP_POLICY_STRICT_CORE_LOCAL
Use a thread on the same CPU core.
@ L4_THREAD_GROUP_REMOVE_OP
Remove thread from thread group.
@ L4_THREAD_GROUP_ADD_OP
Add thread to thread group.
#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:369
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:167
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
Common IPC interface.
Common L4 ABI Data Types.
UTCB definitions.
Message tag data structure.
Definition types.h:269
l4_umword_t raw
Raw value.
Definition __l4_fpage.h:78
Encapsulation of the message-register block in the UTCB.
Definition utcb.h:133
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:134