L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1
5/*
6 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
7 * Alexander Warg <warg@os.inf.tu-dresden.de>,
8 * Björn Döbel <doebel@os.inf.tu-dresden.de>,
9 * Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
10 * economic rights: Technische Universität Dresden (Germany)
11 *
12 * License: see LICENSE.spdx (in this directory or the directories above)
13 */
14#pragma once
15
16#include <l4/sys/types.h>
17#include <l4/sys/utcb.h>
18#include <l4/sys/ipc.h>
19
54
55
86
95 l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW;
96
131 l4_umword_t *flags) L4_NOTHROW;
132
141 l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW;
142
143
144
170
190L4_INLINE void
192
197L4_INLINE void
198l4_thread_control_start_u(l4_utcb_t *utcb) L4_NOTHROW;
199
209L4_INLINE void
211
216L4_INLINE void
217l4_thread_control_pager_u(l4_cap_idx_t pager, l4_utcb_t *utcb) L4_NOTHROW;
218
228L4_INLINE void
230
235L4_INLINE void
236l4_thread_control_exc_handler_u(l4_cap_idx_t exc_handler,
237 l4_utcb_t *utcb) L4_NOTHROW;
238
266L4_INLINE void
269
274L4_INLINE void
275l4_thread_control_bind_u(l4_utcb_t *thread_utcb,
276 l4_cap_idx_t task, l4_utcb_t *utcb) L4_NOTHROW;
277
301L4_INLINE void
303
308L4_INLINE void
309l4_thread_control_alien_u(l4_utcb_t *utcb, int on) L4_NOTHROW;
310
311
312
313
332
338l4_thread_control_commit_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW;
339
348
359
365l4_thread_switch_u(l4_cap_idx_t to_thread, l4_utcb_t *utcb) L4_NOTHROW;
366
367
368
380
386l4_thread_stats_time_u(l4_cap_idx_t thread, l4_kernel_clock_t *us,
387 l4_utcb_t *utcb) L4_NOTHROW;
388
389
402
408l4_thread_vcpu_resume_start_u(l4_utcb_t *utcb) L4_NOTHROW;
409
460
466l4_thread_vcpu_resume_commit_u(l4_cap_idx_t thread,
467 l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW;
468
469
491
501 l4_utcb_t *utcb) L4_NOTHROW;
502
536
546 l4_utcb_t *utcb) L4_NOTHROW;
547
548
574
580l4_thread_register_del_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
581 l4_utcb_t *utcb) L4_NOTHROW;
582
606
612l4_thread_modify_sender_start_u(l4_utcb_t *u) L4_NOTHROW;
613
638L4_INLINE int
640 l4_umword_t match,
641 l4_umword_t del_bits,
642 l4_umword_t add_bits,
644
649L4_INLINE int
650l4_thread_modify_sender_add_u(l4_umword_t match_mask,
651 l4_umword_t match,
652 l4_umword_t del_bits,
653 l4_umword_t add_bits,
655
683
689l4_thread_modify_sender_commit_u(l4_cap_idx_t thread, l4_msgtag_t tag,
691
692
716
722l4_thread_register_doorbell_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
724
752 l4_addr_t pf_tramp_state) L4_NOTHROW;
753
759l4_thread_pf_trampoline_setup_u(l4_cap_idx_t thread, l4_addr_t pf_tramp_state,
760 l4_utcb_t *utcb) L4_NOTHROW;
761
773
779l4_thread_pf_trampoline_resume_u(l4_cap_idx_t thread,
780 l4_utcb_t *utcb) L4_NOTHROW;
781
794
800l4_thread_pf_trampoline_reflect_u(l4_cap_idx_t thread,
801 l4_utcb_t *utcb) L4_NOTHROW;
802
813
819l4_thread_pf_trampoline_disable_u(l4_cap_idx_t thread, int *was_enabled,
820 l4_utcb_t *utcb) L4_NOTHROW;
821
830
836l4_thread_pf_trampoline_enable_u(l4_cap_idx_t thread,
837 l4_utcb_t *utcb) L4_NOTHROW;
838
839
865
887
906
919
949
950/* IMPLEMENTATION -----------------------------------------------------------*/
951
952#include <l4/sys/ipc.h>
953#include <l4/sys/types.h>
954
957 l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW
958{
959 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
960 v->mr[0] = L4_THREAD_EX_REGS_OP | flags;
961 v->mr[1] = ip;
962 v->mr[2] = sp;
963 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 3, 0, 0), L4_IPC_NEVER);
964}
965
968 l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW
969{
970 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
971 l4_msgtag_t ret = l4_thread_ex_regs_u(thread, *ip, *sp, *flags, utcb);
972 if (l4_error_u(ret, utcb))
973 return ret;
974
975 *flags = v->mr[0];
976 *ip = v->mr[1];
977 *sp = v->mr[2];
978 return ret;
979}
980
981L4_INLINE void
982l4_thread_control_start_u(l4_utcb_t *utcb) L4_NOTHROW
983{
984 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
986}
987
988L4_INLINE void
989l4_thread_control_pager_u(l4_cap_idx_t pager, l4_utcb_t *utcb) L4_NOTHROW
990{
991 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
994}
995
996L4_INLINE void
997l4_thread_control_exc_handler_u(l4_cap_idx_t exc_handler,
998 l4_utcb_t *utcb) L4_NOTHROW
999{
1000 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1002 v->mr[L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER] = exc_handler;
1003}
1004
1005L4_INLINE void
1006l4_thread_control_bind_u(l4_utcb_t *thread_utcb, l4_cap_idx_t task,
1007 l4_utcb_t *utcb) L4_NOTHROW
1008{
1009 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1014}
1015
1016L4_INLINE void
1017l4_thread_control_alien_u(l4_utcb_t *utcb, int on) L4_NOTHROW
1018{
1019 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1022}
1023
1025l4_thread_control_commit_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW
1026{
1027 int items = 0;
1028 if (l4_utcb_mr_u(utcb)->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] & L4_THREAD_CONTROL_BIND_TASK)
1029 items = 1;
1030 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 6, items, 0), L4_IPC_NEVER);
1031}
1032
1033
1036{
1038 return l4_msgtag(0, 0, 0, 0);
1039}
1040
1041/* Preliminary, to be changed */
1043l4_thread_switch_u(l4_cap_idx_t to_thread, l4_utcb_t *utcb) L4_NOTHROW
1044{
1045 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1046 v->mr[0] = L4_THREAD_SWITCH_OP;
1047 return l4_ipc_call(to_thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0), L4_IPC_NEVER);
1048}
1049
1050
1052l4_thread_stats_time_u(l4_cap_idx_t thread, l4_kernel_clock_t *us,
1053 l4_utcb_t *utcb) L4_NOTHROW
1054{
1055 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1056 l4_msgtag_t res;
1057
1058 v->mr[0] = L4_THREAD_STATS_OP;
1059
1060 res = l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0), L4_IPC_NEVER);
1061
1062 if (l4_msgtag_has_error(res))
1063 return res;
1064
1065 *us = v->mr64[l4_utcb_mr64_idx(0)];
1066
1067 return res;
1068}
1069
1071l4_thread_vcpu_resume_start_u(l4_utcb_t *utcb) L4_NOTHROW
1072{
1073 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1075 return l4_msgtag(L4_PROTO_THREAD, 1, 0, 0);
1076}
1077
1079l4_thread_vcpu_resume_commit_u(l4_cap_idx_t thread,
1080 l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
1081{
1082 return l4_ipc_call(thread, utcb, tag, L4_IPC_NEVER);
1083}
1084
1087 l4_umword_t flags) L4_NOTHROW
1088{
1089 return l4_thread_ex_regs_u(thread, ip, sp, flags, l4_utcb());
1090}
1091
1094 l4_umword_t *flags) L4_NOTHROW
1095{
1096 return l4_thread_ex_regs_ret_u(thread, ip, sp, flags, l4_utcb());
1097}
1098
1099L4_INLINE void
1101{
1102 l4_thread_control_start_u(l4_utcb());
1103}
1104
1105L4_INLINE void
1107{
1108 l4_thread_control_pager_u(pager, l4_utcb());
1109}
1110
1111L4_INLINE void
1113{
1114 l4_thread_control_exc_handler_u(exc_handler, l4_utcb());
1115}
1116
1117
1118L4_INLINE void
1120{
1121 l4_thread_control_bind_u(thread_utcb, task, l4_utcb());
1122}
1123
1124L4_INLINE void
1126{
1127 l4_thread_control_alien_u(l4_utcb(), on);
1128}
1129
1132{
1133 return l4_thread_control_commit_u(thread, l4_utcb());
1134}
1135
1136
1137
1138
1141{
1142 return l4_thread_switch_u(to_thread, l4_utcb());
1143}
1144
1145
1146
1147
1150{
1151 return l4_thread_stats_time_u(thread, us, l4_utcb());
1152}
1153
1156{
1157 return l4_thread_vcpu_resume_start_u(l4_utcb());
1158}
1159
1163{
1164 return l4_thread_vcpu_resume_commit_u(thread, tag, l4_utcb());
1165}
1166
1167
1169l4_thread_register_del_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
1171{
1172 l4_msg_regs_t *m = l4_utcb_mr_u(u);
1174 m->mr[1] = l4_map_obj_control(0,0);
1175 m->mr[2] = l4_obj_fpage(irq, 0, L4_CAP_FPAGE_RWS).raw;
1176 return l4_ipc_call(thread, u, l4_msgtag(L4_PROTO_THREAD, 1, 1, 0), L4_IPC_NEVER);
1177
1178}
1179
1182{
1183 return l4_thread_register_del_irq_u(thread, irq, l4_utcb());
1184}
1185
1186
1189 l4_utcb_t *utcb) L4_NOTHROW
1190{
1191 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1193 v->mr[1] = vcpu_state;
1194 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0), L4_IPC_NEVER);
1195}
1196
1199{ return l4_thread_vcpu_control_u(thread, vcpu_state, l4_utcb()); }
1200
1201
1204 l4_utcb_t *utcb) L4_NOTHROW
1205{
1206 l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
1207 v->mr[0] = L4_THREAD_VCPU_CONTROL_EXT_OP;
1208 v->mr[1] = ext_vcpu_state;
1209 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0), L4_IPC_NEVER);
1210}
1211
1214{ return l4_thread_vcpu_control_ext_u(thread, ext_vcpu_state, l4_utcb()); }
1215
1217l4_thread_modify_sender_start_u(l4_utcb_t *u) L4_NOTHROW
1218{
1219 l4_msg_regs_t *m = l4_utcb_mr_u(u);
1221 return l4_msgtag(L4_PROTO_THREAD, 1, 0, 0);
1222}
1223
1224L4_INLINE int
1225l4_thread_modify_sender_add_u(l4_umword_t match_mask,
1226 l4_umword_t match,
1227 l4_umword_t del_bits,
1228 l4_umword_t add_bits,
1230{
1231 l4_msg_regs_t *m = l4_utcb_mr_u(u);
1232 unsigned w = l4_msgtag_words(*tag);
1233 if (w >= L4_UTCB_GENERIC_DATA_SIZE - 4)
1234 return -L4_ENOMEM;
1235
1236 m->mr[w] = match_mask;
1237 m->mr[w+1] = match;
1238 m->mr[w+2] = del_bits;
1239 m->mr[w+3] = add_bits;
1240
1241 *tag = l4_msgtag(l4_msgtag_label(*tag), w + 4, 0, 0);
1242
1243 return 0;
1244}
1245
1247l4_thread_modify_sender_commit_u(l4_cap_idx_t thread, l4_msgtag_t tag,
1249{
1250 return l4_ipc_call(thread, u, tag, L4_IPC_NEVER);
1251}
1252
1255{
1256 return l4_thread_modify_sender_start_u(l4_utcb());
1257}
1258
1259L4_INLINE int
1261 l4_umword_t match,
1262 l4_umword_t del_bits,
1263 l4_umword_t add_bits,
1265{
1266 return l4_thread_modify_sender_add_u(match_mask, match,
1267 del_bits, add_bits, tag, l4_utcb());
1268}
1269
1272{
1273 return l4_thread_modify_sender_commit_u(thread, tag, l4_utcb());
1274}
1275
1276
1278l4_thread_register_doorbell_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
1280{
1281 l4_msg_regs_t *m = l4_utcb_mr_u(u);
1283 m->mr[1] = l4_map_obj_control(0,0);
1284 m->mr[2] = l4_obj_fpage(irq, 0, L4_CAP_FPAGE_RWS).raw;
1285 return l4_ipc_call(thread, u, l4_msgtag(L4_PROTO_THREAD, 1, 1, 0),
1286 L4_IPC_NEVER);
1287}
1288
1292{
1293 return l4_thread_register_doorbell_irq_u(thread, irq, l4_utcb());
1294}
1295
1296
1299 l4_addr_t pf_tramp_state) L4_NOTHROW
1300{
1301 return l4_thread_pf_trampoline_setup_u(thread, pf_tramp_state, l4_utcb());
1302}
1303
1305l4_thread_pf_trampoline_setup_u(l4_cap_idx_t thread, l4_addr_t pf_tramp_state,
1306 l4_utcb_t *utcb) L4_NOTHROW
1307{
1308 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
1310 m->mr[1] = pf_tramp_state;
1311 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0),
1312 L4_IPC_NEVER);
1313}
1314
1317{
1318 return l4_thread_pf_trampoline_resume_u(thread, l4_utcb());
1319}
1320
1322l4_thread_pf_trampoline_resume_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW
1323{
1324 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
1326 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0),
1327 L4_IPC_NEVER);
1328}
1329
1332{
1333 return l4_thread_pf_trampoline_reflect_u(thread, l4_utcb());
1334}
1335
1337l4_thread_pf_trampoline_reflect_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW
1338{
1339 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
1341 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0),
1342 L4_IPC_NEVER);
1343}
1344
1347{
1348 return l4_thread_pf_trampoline_disable_u(thread, was_enabled, l4_utcb());
1349}
1350
1352l4_thread_pf_trampoline_disable_u(l4_cap_idx_t thread, int *was_enabled,
1353 l4_utcb_t *utcb) L4_NOTHROW
1354{
1355 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
1356 l4_msgtag_t res;
1357
1359 res = l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0),
1360 L4_IPC_NEVER);
1361
1362 if (was_enabled)
1363 *was_enabled = m->mr[0];
1364 return res;
1365}
1366
1369{
1370 return l4_thread_pf_trampoline_enable_u(thread, l4_utcb());
1371}
1372
1374l4_thread_pf_trampoline_enable_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW
1375{
1376 l4_msg_regs_t *m = l4_utcb_mr_u(utcb);
1378 return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0),
1379 L4_IPC_NEVER);
1380}
1381
1382#include <l4/sys/arch/thread.h>
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition l4int.h:53
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:372
#define L4_INVALID_CAP
Invalid capability selector; see l4_cap_idx_t.
Definition consts.h:165
@ L4_ENOMEM
No memory.
Definition err.h:40
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_receive(l4_cap_idx_t object, l4_utcb_t *utcb, l4_timeout_t timeout) L4_NOTHROW
Wait for a message from a specific source.
Definition ipc.h:643
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_ITEM_MAP
Identify a message item as map item.
Definition consts.h:225
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition types.h:476
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
unsigned l4_msgtag_words(l4_msgtag_t t) L4_NOTHROW
Get the number of untyped words.
Definition types.h:463
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition types.h:453
@ L4_PROTO_THREAD
Protocol for messages to a thread object.
Definition types.h:70
L4_thread_ops
Operations on thread objects.
Definition thread.h:847
@ L4_THREAD_OPCODE_MASK
Mask for opcodes.
Definition thread.h:863
@ L4_THREAD_AMD64_GET_SEGMENT_INFO_OP
Get segment information.
Definition thread.h:862
@ L4_THREAD_REGISTER_DOORBELL_IRQ_OP
Register direct IRQ injection doorbell IRQ.
Definition thread.h:857
@ L4_THREAD_AMD64_SET_SEGMENT_BASE_OP
Set segment base.
Definition thread.h:861
@ L4_THREAD_X86_GDT_OP
Gdt.
Definition thread.h:859
@ L4_THREAD_EX_REGS_OP
Exchange registers operation.
Definition thread.h:849
@ L4_THREAD_STATS_OP
Thread statistics.
Definition thread.h:851
@ L4_THREAD_VCPU_CONTROL_OP
Enable / disable VCPU feature.
Definition thread.h:855
@ L4_THREAD_PF_TRAMP_CONTROL_OP
Page fault trampoline control operation.
Definition thread.h:858
@ L4_THREAD_MODIFY_SENDER_OP
Modify all senders IDs that match the given pattern.
Definition thread.h:854
@ L4_THREAD_CONTROL_OP
Control operation.
Definition thread.h:848
@ L4_THREAD_ARM_TPIDRURO_OP
Set TPIDRURO register.
Definition thread.h:860
@ L4_THREAD_VCPU_RESUME_OP
VCPU resume.
Definition thread.h:852
@ L4_THREAD_REGISTER_DELETE_IRQ_OP
Register an IPC-gate deletion IRQ.
Definition thread.h:853
@ L4_THREAD_SWITCH_OP
Do a thread switch.
Definition thread.h:850
l4_msgtag_t l4_thread_modify_sender_start(void) L4_NOTHROW
Start a thread sender modification sequence.
Definition thread.h:1254
l4_msgtag_t l4_thread_vcpu_control_ext_u(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state, l4_utcb_t *utcb) L4_NOTHROW
Enable the extended vCPU feature for the thread.
Definition thread.h:1203
l4_msgtag_t l4_thread_ex_regs(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp, l4_umword_t flags) L4_NOTHROW
Exchange basic thread registers.
Definition thread.h:1086
L4_thread_ex_regs_flags
Flags for the thread ex-regs operation.
Definition thread.h:913
l4_msgtag_t l4_thread_pf_trampoline_setup(l4_cap_idx_t thread, l4_addr_t pf_tramp_state) L4_NOTHROW
Setup page fault trampoline handler.
Definition thread.h:1298
l4_msgtag_t l4_thread_pf_trampoline_resume(l4_cap_idx_t thread) L4_NOTHROW
Resume from page fault trampoline handler.
Definition thread.h:1316
int l4_thread_modify_sender_add(l4_umword_t match_mask, l4_umword_t match, l4_umword_t del_bits, l4_umword_t add_bits, l4_msgtag_t *tag) L4_NOTHROW
Add a modification pattern to a sender modification sequence.
Definition thread.h:1260
l4_msgtag_t l4_thread_pf_trampoline_disable(l4_cap_idx_t thread, int *was_enabled) L4_NOTHROW
Disable the page fault trampoline handling for this thread.
Definition thread.h:1346
l4_msgtag_t l4_thread_vcpu_control_ext(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state) L4_NOTHROW
Enable the extended vCPU feature for the thread.
Definition thread.h:1213
l4_msgtag_t l4_thread_ex_regs_ret_u(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp, l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW
Exchange basic thread registers and return previous values.
Definition thread.h:967
l4_msgtag_t l4_thread_yield(void) L4_NOTHROW
Yield current time slice.
Definition thread.h:1035
l4_msgtag_t l4_thread_vcpu_resume_start(void) L4_NOTHROW
vCPU return from event handler.
Definition thread.h:1155
l4_msgtag_t l4_thread_pf_trampoline_reflect(l4_cap_idx_t thread) L4_NOTHROW
Page fault trampoline handler reflects page fault to exception handler.
Definition thread.h:1331
L4_thread_control_flags
Flags for the thread control operation.
Definition thread.h:877
l4_msgtag_t l4_thread_ex_regs_ret(l4_cap_idx_t thread, l4_addr_t *ip, l4_addr_t *sp, l4_umword_t *flags) L4_NOTHROW
Exchange basic thread registers and return previous values.
Definition thread.h:1093
l4_msgtag_t l4_thread_stats_time(l4_cap_idx_t thread, l4_kernel_clock_t *us) L4_NOTHROW
Get consumed time of thread in µs.
Definition thread.h:1149
l4_msgtag_t l4_thread_vcpu_control_u(l4_cap_idx_t thread, l4_addr_t vcpu_state, l4_utcb_t *utcb) L4_NOTHROW
Enable the vCPU feature for the thread.
Definition thread.h:1188
l4_msgtag_t l4_thread_ex_regs_u(l4_cap_idx_t thread, l4_addr_t ip, l4_addr_t sp, l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW
Exchange basic thread registers.
Definition thread.h:956
l4_msgtag_t l4_thread_register_del_irq(l4_cap_idx_t thread, l4_cap_idx_t irq) L4_NOTHROW
Register an IRQ that will trigger upon deletion events.
Definition thread.h:1181
l4_msgtag_t l4_thread_vcpu_resume_commit(l4_cap_idx_t thread, l4_msgtag_t tag) L4_NOTHROW
Commit vCPU resume.
Definition thread.h:1161
l4_msgtag_t l4_thread_modify_sender_commit(l4_cap_idx_t thread, l4_msgtag_t tag) L4_NOTHROW
Apply (commit) a sender modification sequence.
Definition thread.h:1271
l4_msgtag_t l4_thread_register_doorbell_irq(l4_cap_idx_t thread, l4_cap_idx_t irq) L4_NOTHROW
Register an IRQ that will trigger when a forwarded virtual interrupt is pending.
Definition thread.h:1290
l4_msgtag_t l4_thread_switch(l4_cap_idx_t to_thread) L4_NOTHROW
Switch to another thread (and donate the remaining time slice).
Definition thread.h:1140
l4_msgtag_t l4_thread_vcpu_control(l4_cap_idx_t thread, l4_addr_t vcpu_state) L4_NOTHROW
Enable the vCPU feature for the thread.
Definition thread.h:1198
l4_msgtag_t l4_thread_pf_trampoline_enable(l4_cap_idx_t thread) L4_NOTHROW
Re-enable the page fault trampoline handling for this thread.
Definition thread.h:1368
L4_thread_control_mr_indices
Indices for the values in the message register for thread control.
Definition thread.h:898
L4_pf_tramp_control_op
Sub-opcodes for L4_THREAD_PF_TRAMP_CONTROL_OP.
Definition thread.h:926
@ L4_THREAD_EX_REGS_CANCEL
Cancel ongoing IPC in the thread.
Definition thread.h:914
@ L4_THREAD_EX_REGS_ARCH_MASK
Arch specific flags.
Definition thread.h:917
@ L4_THREAD_EX_REGS_TRIGGER_EXCEPTION
Trigger artificial exception in thread.
Definition thread.h:915
@ L4_THREAD_CONTROL_SET_PAGER
The pager will be given.
Definition thread.h:879
@ L4_THREAD_CONTROL_BIND_TASK
The task to bind the thread to will be given.
Definition thread.h:881
@ L4_THREAD_CONTROL_ALIEN
Alien state of the thread is set.
Definition thread.h:883
@ L4_THREAD_CONTROL_SET_EXC_HANDLER
The exception handler of the thread will be given.
Definition thread.h:885
@ L4_THREAD_CONTROL_MR_IDX_FLAG_VALS
Index for feature values.
Definition thread.h:902
@ L4_THREAD_CONTROL_MR_IDX_PAGER
Index for pager cap.
Definition thread.h:900
@ L4_THREAD_CONTROL_MR_IDX_BIND_TASK
Index for task flexpage for bind.
Definition thread.h:904
@ L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER
Index for exception handler.
Definition thread.h:901
@ L4_THREAD_CONTROL_MR_IDX_FLAGS
Definition thread.h:899
@ L4_THREAD_CONTROL_MR_IDX_BIND_UTCB
Index for UTCB address for bind.
Definition thread.h:903
@ L4_THREAD_PF_TRAMP_CONTROL_OP_REFLECT
Resume from PF trampoline handler – trigger exception.
Definition thread.h:932
@ L4_THREAD_PF_TRAMP_CONTROL_OP_SETUP
Setup PF trampoline handler.
Definition thread.h:928
@ L4_THREAD_PF_TRAMP_CONTROL_OP_DISABLE
Disable PF trampoline handler.
Definition thread.h:940
@ L4_THREAD_PF_TRAMP_CONTROL_OP_RESUME
Normal resume from PF trampoline handler to userland.
Definition thread.h:930
@ L4_THREAD_PF_TRAMP_CONTROL_OP_ENABLE
Re-enable PF trampoline handler.
Definition thread.h:947
void l4_thread_control_bind(l4_utcb_t *thread_utcb, l4_cap_idx_t task) L4_NOTHROW
Bind the thread to a task.
Definition thread.h:1119
l4_msgtag_t l4_thread_control_commit(l4_cap_idx_t thread) L4_NOTHROW
Commit the thread control parameters.
Definition thread.h:1131
void l4_thread_control_alien(int on) L4_NOTHROW
Enable alien mode.
Definition thread.h:1125
void l4_thread_control_exc_handler(l4_cap_idx_t exc_handler) L4_NOTHROW
Set the exception handler.
Definition thread.h:1112
void l4_thread_control_start(void) L4_NOTHROW
Start a thread control API sequence.
Definition thread.h:1100
void l4_thread_control_pager(l4_cap_idx_t pager) L4_NOTHROW
Set the pager.
Definition thread.h:1106
unsigned l4_utcb_mr64_idx(unsigned idx) L4_NOTHROW
Get index into 64bit message registers alias from native-sized index.
Definition utcb.h:415
#define L4_IPC_BOTH_TIMEOUT_0
0 receive and send timeout
Definition __timeout.h:79
#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
l4_uint64_t mr64[L4_UTCB_GENERIC_DATA_SIZE/(sizeof(l4_uint64_t)/sizeof(l4_umword_t))]
Message registers 64bit alias.
Definition utcb.h:135