L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1
7
8/*
9 * (c) 2003-2009 Author(s)
10 * economic rights: Technische Universität Dresden (Germany)
11 * License: see LICENSE.spdx (in this directory or the directories above)
12 */
13
14#pragma once
15
16#include <l4/sys/compiler.h>
17#include <l4/sys/types.h>
18#include <l4/sys/scheduler.h>
19
20#include <l4/util/arch/thread.h>
21
23
28
46L4_CV long
47l4util_create_thread(l4_cap_idx_t id, l4_utcb_t *thread_utcb,
48 l4_cap_idx_t factory,
50 l4_cap_idx_t task,
52
54
55#ifndef L4UTIL_THREAD_FUNC
74# define __L4UTIL_THREAD_FUNC(name) void L4_NORETURN name(void)
75# define L4UTIL_THREAD_FUNC(name) __L4UTIL_THREAD_FUNC(name)
76# define __L4UTIL_THREAD_STATIC_FUNC(name) static L4_NORETURN void name(void)
77# define L4UTIL_THREAD_STATIC_FUNC(name) __L4UTIL_THREAD_STATIC_FUNC(name)
78#endif
79
80#ifndef L4UTIL_THREAD_CXX_FUNC_HELPER_PROTO_ATTR
81# define L4UTIL_THREAD_CXX_FUNC_HELPER_PROTO_ATTR
82#endif
83#ifndef L4UTIL_THREAD_CXX_FUNC_INTERRUPT_HELPER_PROTO_ATTR
84# define L4UTIL_THREAD_CXX_FUNC_INTERRUPT_HELPER_PROTO_ATTR
85#endif
86
102#define _L4UTIL_THREAD_CXX_FUNC_IMPL_(suffix, class, fn_name, from_asm_name, ...)\
103 asm (".global " L4_stringify(fn_name ## _stub) "\n" \
104 ".type " L4_stringify(fn_name ## _stub) " STT_FUNC \n" \
105 L4_stringify(fn_name ## _stub) ": \n" \
106 L4UTIL_THREAD_CXX_FUNC_IMPL ## suffix ## _STUB(from_asm_name) \
107 ); \
108 \
109 [[noreturn]] void __attribute__((used)) class::from_asm_name(__VA_ARGS__)
110
111#define _L4UTIL_THREAD_CXX_FUNC_IMPL(suffix, class, fn_name, ...) \
112 _L4UTIL_THREAD_CXX_FUNC_IMPL_(suffix, class, fn_name, fn_name ## _from_asm, \
113 ##__VA_ARGS__)
114
115#ifndef L4UTIL_THREAD_CXX_FUNC_PROTO
116
127# define L4UTIL_THREAD_CXX_FUNC_PROTO(fn_name, ...) \
128 [[noreturn]] static void fn_name(__VA_ARGS__) \
129 asm (L4_stringify(fn_name ## _stub)); \
130 [[noreturn]] static void fn_name ## _from_asm(__VA_ARGS__) \
131 asm (L4_stringify(fn_name ## _from_asm))
132
133#endif
134
168
169#ifdef L4UTIL_THREAD_CXX_FUNC_IMPL_STUB
170
171# define L4UTIL_THREAD_CXX_FUNC_IMPL(class, fn_name, ...) \
172 _L4UTIL_THREAD_CXX_FUNC_IMPL(, class, fn_name, ##__VA_ARGS__)
173
174#else /* !L4UTIL_THREAD_CXX_FUNC_IMPL_STUB */
175
176# define L4UTIL_THREAD_CXX_FUNC_IMPL(class, fn_name, ...) \
177 [[noreturn]] void class::fn_name(__VA_ARGS__)
178
179#endif
180
190#ifndef L4UTIL_THREAD_CXX_FUNC_IMPL_INTERRUPT_STUB
191# error architecture-specific L4UTIL_THREAD_CXX_FUNC_IMPL_INTERRUPT_STUB missing
192#endif
193
194#define L4UTIL_THREAD_CXX_FUNC_INTERRUPT_IMPL(class, fn_name, ...) \
195 _L4UTIL_THREAD_CXX_FUNC_IMPL(_INTERRUPT, class, fn_name, ##__VA_ARGS__)
L4 compiler related defines.
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:372
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
#define L4_CV
Define calling convention.
Definition linkage.h:33
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:167
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:171
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:172
Common L4 ABI Data Types.
Scheduler parameter set.
Definition scheduler.h:174
Scheduler object functions.