L4Re – L4 Runtime Environment
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  * This file is part of TUD:OS and distributed under the terms of the
13  * GNU General Public License 2.
14  * Please see the COPYING-GPL-2 file for details.
15  *
16  * As a special exception, you may use this file as part of a free software
17  * library without restriction. Specifically, if other files instantiate
18  * templates or use macros or inline functions from this file, or you compile
19  * this file and link it with other files to produce an executable, this
20  * file does not by itself cause the resulting executable to be covered by
21  * the GNU General Public License. This exception does not however
22  * invalidate any other reasons why the executable file might be covered by
23  * the GNU General Public License.
24  */
25 #pragma once
26 
27 #include <l4/sys/types.h>
28 #include <l4/sys/utcb.h>
29 #include <l4/sys/ipc.h>
30 
87 L4_INLINE l4_msgtag_t
89  l4_umword_t flags) L4_NOTHROW;
90 
97 L4_INLINE l4_msgtag_t
99  l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW;
100 
124 L4_INLINE l4_msgtag_t
126  l4_umword_t *flags) L4_NOTHROW;
127 
134 L4_INLINE l4_msgtag_t
136  l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW;
137 
138 
139 
187 L4_INLINE void
189 
194 L4_INLINE void
195 l4_thread_control_start_u(l4_utcb_t *utcb) L4_NOTHROW;
196 
206 L4_INLINE void
208 
213 L4_INLINE void
214 l4_thread_control_pager_u(l4_cap_idx_t pager, l4_utcb_t *utcb) L4_NOTHROW;
215 
225 L4_INLINE void
227 
232 L4_INLINE void
233 l4_thread_control_exc_handler_u(l4_cap_idx_t exc_handler,
234  l4_utcb_t *utcb) L4_NOTHROW;
235 
256 L4_INLINE void
257 l4_thread_control_bind(l4_utcb_t *thread_utcb,
258  l4_cap_idx_t task) L4_NOTHROW;
259 
264 L4_INLINE void
265 l4_thread_control_bind_u(l4_utcb_t *thread_utcb,
266  l4_cap_idx_t task, l4_utcb_t *utcb) L4_NOTHROW;
267 
282 L4_INLINE void
284 
289 L4_INLINE void
290 l4_thread_control_alien_u(l4_utcb_t *utcb, int on) L4_NOTHROW;
291 
302 L4_INLINE void
304 
309 L4_INLINE void
310 l4_thread_control_ux_host_syscall_u(l4_utcb_t *utcb, int on) L4_NOTHROW;
311 
312 
313 
321 L4_INLINE l4_msgtag_t
323 
328 L4_INLINE l4_msgtag_t
329 l4_thread_control_commit_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW;
330 
337 L4_INLINE l4_msgtag_t
339 
348 L4_INLINE l4_msgtag_t
350 
355 L4_INLINE l4_msgtag_t
356 l4_thread_switch_u(l4_cap_idx_t to_thread, l4_utcb_t *utcb) L4_NOTHROW;
357 
358 
359 
369 L4_INLINE l4_msgtag_t
371 
376 L4_INLINE l4_msgtag_t
377 l4_thread_stats_time_u(l4_cap_idx_t thread, l4_kernel_clock_t *us,
378  l4_utcb_t *utcb) L4_NOTHROW;
379 
380 
391 L4_INLINE l4_msgtag_t
393 
398 L4_INLINE l4_msgtag_t
399 l4_thread_vcpu_resume_start_u(l4_utcb_t *utcb) L4_NOTHROW;
400 
427 L4_INLINE l4_msgtag_t
429  l4_msgtag_t tag) L4_NOTHROW;
430 
435 L4_INLINE l4_msgtag_t
436 l4_thread_vcpu_resume_commit_u(l4_cap_idx_t thread,
437  l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW;
438 
439 
456 L4_INLINE l4_msgtag_t
458 
466 L4_INLINE l4_msgtag_t
468  l4_utcb_t *utcb) L4_NOTHROW;
469 
492 L4_INLINE l4_msgtag_t
494 
502 L4_INLINE l4_msgtag_t
504  l4_utcb_t *utcb) L4_NOTHROW;
505 
506 
519 L4_INLINE l4_msgtag_t
521 
526 L4_INLINE l4_msgtag_t
527 l4_thread_register_del_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
528  l4_utcb_t *utcb) L4_NOTHROW;
529 
541 L4_INLINE l4_msgtag_t
543 
548 L4_INLINE l4_msgtag_t
549 l4_thread_modify_sender_start_u(l4_utcb_t *u) L4_NOTHROW;
550 
575 L4_INLINE int
577  l4_umword_t match,
578  l4_umword_t del_bits,
579  l4_umword_t add_bits,
580  l4_msgtag_t *tag) L4_NOTHROW;
581 
586 L4_INLINE int
587 l4_thread_modify_sender_add_u(l4_umword_t match_mask,
588  l4_umword_t match,
589  l4_umword_t del_bits,
590  l4_umword_t add_bits,
591  l4_msgtag_t *tag, l4_utcb_t *u) L4_NOTHROW;
592 
604 L4_INLINE l4_msgtag_t
606 
611 L4_INLINE l4_msgtag_t
612 l4_thread_modify_sender_commit_u(l4_cap_idx_t thread, l4_msgtag_t tag,
613  l4_utcb_t *u) L4_NOTHROW;
614 
622 {
631  L4_THREAD_VCPU_CONTROL_EXT_OP = L4_THREAD_VCPU_CONTROL_OP | 0x10000,
637 };
638 
650 {
661 };
662 
673 {
680 };
681 
688 {
691 };
692 
693 
694 /* IMPLEMENTATION -----------------------------------------------------------*/
695 
696 #include <l4/sys/ipc.h>
697 #include <l4/sys/types.h>
698 
699 L4_INLINE l4_msgtag_t
701  l4_umword_t flags, l4_utcb_t *utcb) L4_NOTHROW
702 {
703  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
704  v->mr[0] = L4_THREAD_EX_REGS_OP | flags;
705  v->mr[1] = ip;
706  v->mr[2] = sp;
707  return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 3, 0, 0), L4_IPC_NEVER);
708 }
709 
710 L4_INLINE l4_msgtag_t
712  l4_umword_t *flags, l4_utcb_t *utcb) L4_NOTHROW
713 {
714  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
715  l4_msgtag_t ret = l4_thread_ex_regs_u(thread, *ip, *sp, *flags, utcb);
716  if (l4_error_u(ret, utcb))
717  return ret;
718 
719  *flags = v->mr[0];
720  *ip = v->mr[1];
721  *sp = v->mr[2];
722  return ret;
723 }
724 
725 L4_INLINE void
726 l4_thread_control_start_u(l4_utcb_t *utcb) L4_NOTHROW
727 {
728  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
730 }
731 
732 L4_INLINE void
733 l4_thread_control_pager_u(l4_cap_idx_t pager, l4_utcb_t *utcb) L4_NOTHROW
734 {
735  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
738 }
739 
740 L4_INLINE void
741 l4_thread_control_exc_handler_u(l4_cap_idx_t exc_handler,
742  l4_utcb_t *utcb) L4_NOTHROW
743 {
744  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
746  v->mr[L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER] = exc_handler;
747 }
748 
749 L4_INLINE void
750 l4_thread_control_bind_u(l4_utcb_t *thread_utcb, l4_cap_idx_t task,
751  l4_utcb_t *utcb) L4_NOTHROW
752 {
753  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
758 }
759 
760 L4_INLINE void
761 l4_thread_control_alien_u(l4_utcb_t *utcb, int on) L4_NOTHROW
762 {
763  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
766 }
767 
768 L4_INLINE void
769 l4_thread_control_ux_host_syscall_u(l4_utcb_t *utcb, int on) L4_NOTHROW
770 {
771  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
774 }
775 
776 L4_INLINE l4_msgtag_t
777 l4_thread_control_commit_u(l4_cap_idx_t thread, l4_utcb_t *utcb) L4_NOTHROW
778 {
779  int items = 0;
780  if (l4_utcb_mr_u(utcb)->mr[L4_THREAD_CONTROL_MR_IDX_FLAGS] & L4_THREAD_CONTROL_BIND_TASK)
781  items = 1;
782  return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 6, items, 0), L4_IPC_NEVER);
783 }
784 
785 
786 L4_INLINE l4_msgtag_t
788 {
789  l4_ipc_receive(L4_INVALID_CAP, NULL, L4_IPC_BOTH_TIMEOUT_0);
790  return l4_msgtag(0, 0, 0, 0);
791 }
792 
793 /* Preliminary, to be changed */
794 L4_INLINE l4_msgtag_t
795 l4_thread_switch_u(l4_cap_idx_t to_thread, l4_utcb_t *utcb) L4_NOTHROW
796 {
797  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
798  v->mr[0] = L4_THREAD_SWITCH_OP;
799  return l4_ipc_call(to_thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0), L4_IPC_NEVER);
800 }
801 
802 
803 L4_INLINE l4_msgtag_t
804 l4_thread_stats_time_u(l4_cap_idx_t thread, l4_kernel_clock_t *us,
805  l4_utcb_t *utcb) L4_NOTHROW
806 {
807  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
808  l4_msgtag_t res;
809 
810  v->mr[0] = L4_THREAD_STATS_OP;
811 
812  res = l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 1, 0, 0), L4_IPC_NEVER);
813 
814  if (l4_msgtag_has_error(res))
815  return res;
816 
817  *us = v->mr64[l4_utcb_mr64_idx(0)];
818 
819  return res;
820 }
821 
822 L4_INLINE l4_msgtag_t
823 l4_thread_vcpu_resume_start_u(l4_utcb_t *utcb) L4_NOTHROW
824 {
825  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
827  return l4_msgtag(L4_PROTO_THREAD, 1, 0, 0);
828 }
829 
830 L4_INLINE l4_msgtag_t
831 l4_thread_vcpu_resume_commit_u(l4_cap_idx_t thread,
832  l4_msgtag_t tag, l4_utcb_t *utcb) L4_NOTHROW
833 {
834  return l4_ipc_call(thread, utcb, tag, L4_IPC_NEVER);
835 }
836 
837 L4_INLINE l4_msgtag_t
839  l4_umword_t flags) L4_NOTHROW
840 {
841  return l4_thread_ex_regs_u(thread, ip, sp, flags, l4_utcb());
842 }
843 
844 L4_INLINE l4_msgtag_t
846  l4_umword_t *flags) L4_NOTHROW
847 {
848  return l4_thread_ex_regs_ret_u(thread, ip, sp, flags, l4_utcb());
849 }
850 
851 L4_INLINE void
853 {
854  l4_thread_control_start_u(l4_utcb());
855 }
856 
857 L4_INLINE void
859 {
860  l4_thread_control_pager_u(pager, l4_utcb());
861 }
862 
863 L4_INLINE void
865 {
866  l4_thread_control_exc_handler_u(exc_handler, l4_utcb());
867 }
868 
869 
870 L4_INLINE void
872 {
873  l4_thread_control_bind_u(thread_utcb, task, l4_utcb());
874 }
875 
876 L4_INLINE void
878 {
879  l4_thread_control_alien_u(l4_utcb(), on);
880 }
881 
882 L4_INLINE void
884 {
885  l4_thread_control_ux_host_syscall_u(l4_utcb(), on);
886 }
887 
888 L4_INLINE l4_msgtag_t
890 {
891  return l4_thread_control_commit_u(thread, l4_utcb());
892 }
893 
894 
895 
896 
897 L4_INLINE l4_msgtag_t
899 {
900  return l4_thread_switch_u(to_thread, l4_utcb());
901 }
902 
903 
904 
905 
906 L4_INLINE l4_msgtag_t
908 {
909  return l4_thread_stats_time_u(thread, us, l4_utcb());
910 }
911 
912 L4_INLINE l4_msgtag_t
914 {
915  return l4_thread_vcpu_resume_start_u(l4_utcb());
916 }
917 
918 L4_INLINE l4_msgtag_t
921 {
922  return l4_thread_vcpu_resume_commit_u(thread, tag, l4_utcb());
923 }
924 
925 
926 L4_INLINE l4_msgtag_t
927 l4_thread_register_del_irq_u(l4_cap_idx_t thread, l4_cap_idx_t irq,
929 {
930  l4_msg_regs_t *m = l4_utcb_mr_u(u);
932  m->mr[1] = l4_map_obj_control(0,0);
933  m->mr[2] = l4_obj_fpage(irq, 0, L4_CAP_FPAGE_RWS).raw;
934  return l4_ipc_call(thread, u, l4_msgtag(L4_PROTO_THREAD, 1, 1, 0), L4_IPC_NEVER);
935 
936 }
937 
938 L4_INLINE l4_msgtag_t
940 {
941  return l4_thread_register_del_irq_u(thread, irq, l4_utcb());
942 }
943 
944 
945 L4_INLINE l4_msgtag_t
947  l4_utcb_t *utcb) L4_NOTHROW
948 {
949  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
951  v->mr[1] = vcpu_state;
952  return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0), L4_IPC_NEVER);
953 }
954 
955 L4_INLINE l4_msgtag_t
957 { return l4_thread_vcpu_control_u(thread, vcpu_state, l4_utcb()); }
958 
959 
960 L4_INLINE l4_msgtag_t
962  l4_utcb_t *utcb) L4_NOTHROW
963 {
964  l4_msg_regs_t *v = l4_utcb_mr_u(utcb);
965  v->mr[0] = L4_THREAD_VCPU_CONTROL_EXT_OP;
966  v->mr[1] = ext_vcpu_state;
967  return l4_ipc_call(thread, utcb, l4_msgtag(L4_PROTO_THREAD, 2, 0, 0), L4_IPC_NEVER);
968 }
969 
970 L4_INLINE l4_msgtag_t
972 { return l4_thread_vcpu_control_ext_u(thread, ext_vcpu_state, l4_utcb()); }
973 
974 L4_INLINE l4_msgtag_t
975 l4_thread_modify_sender_start_u(l4_utcb_t *u) L4_NOTHROW
976 {
977  l4_msg_regs_t *m = l4_utcb_mr_u(u);
979  return l4_msgtag(L4_PROTO_THREAD, 1, 0, 0);
980 }
981 
982 L4_INLINE int
983 l4_thread_modify_sender_add_u(l4_umword_t match_mask,
984  l4_umword_t match,
985  l4_umword_t del_bits,
986  l4_umword_t add_bits,
988 {
989  l4_msg_regs_t *m = l4_utcb_mr_u(u);
990  unsigned w = l4_msgtag_words(*tag);
991  if (w >= L4_UTCB_GENERIC_DATA_SIZE - 4)
992  return -L4_ENOMEM;
993 
994  m->mr[w] = match_mask;
995  m->mr[w+1] = match;
996  m->mr[w+2] = del_bits;
997  m->mr[w+3] = add_bits;
998 
999  *tag = l4_msgtag(l4_msgtag_label(*tag), w + 4, 0, 0);
1000 
1001  return 0;
1002 }
1003 
1004 L4_INLINE l4_msgtag_t
1005 l4_thread_modify_sender_commit_u(l4_cap_idx_t thread, l4_msgtag_t tag,
1006  l4_utcb_t *u) L4_NOTHROW
1007 {
1008  return l4_ipc_call(thread, u, tag, L4_IPC_NEVER);
1009 }
1010 
1011 L4_INLINE l4_msgtag_t
1013 {
1014  return l4_thread_modify_sender_start_u(l4_utcb());
1015 }
1016 
1017 L4_INLINE int
1019  l4_umword_t match,
1020  l4_umword_t del_bits,
1021  l4_umword_t add_bits,
1022  l4_msgtag_t *tag) L4_NOTHROW
1023 {
1024  return l4_thread_modify_sender_add_u(match_mask, match,
1025  del_bits, add_bits, tag, l4_utcb());
1026 }
1027 
1028 L4_INLINE l4_msgtag_t
1030 {
1031  return l4_thread_modify_sender_commit_u(thread, tag, l4_utcb());
1032 }
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition: compiler.h:186
unsigned long l4_umword_t
Unsigned machine word.
Definition: l4int.h:52
unsigned long l4_addr_t
Address type.
Definition: l4int.h:45
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Definition: l4int.h:65
unsigned long l4_cap_idx_t
L4 Capability selector Type.
Definition: types.h:342
@ L4_INVALID_CAP
Invalid capability selector.
Definition: consts.h:141
@ L4_ENOMEM
No memory.
Definition: err.h:50
l4_fpage_t l4_obj_fpage(l4_cap_idx_t obj, unsigned int order, unsigned char rights) L4_NOTHROW
Create a kernel-object flex page.
Definition: __l4_fpage.h:647
@ L4_CAP_FPAGE_RWS
Read, interface specific 'W', and 'S' rights for capability flex-pages.
Definition: __l4_fpage.h:192
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:490
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:448
l4_umword_t l4_map_obj_control(l4_umword_t spot, unsigned grant) L4_NOTHROW
Create the first word for a map item for the object space.
Definition: __l4_fpage.h:681
@ L4_ITEM_MAP
Identify a message item as map item.
Definition: consts.h:189
unsigned l4_msgtag_has_error(l4_msgtag_t t) L4_NOTHROW
Test for error indicator flag.
Definition: types.h:437
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:408
unsigned l4_msgtag_words(l4_msgtag_t t) L4_NOTHROW
Get the number of untyped words.
Definition: types.h:424
long l4_msgtag_label(l4_msgtag_t t) L4_NOTHROW
Get the protocol of tag.
Definition: types.h:420
@ L4_PROTO_THREAD
Protocol for messages to a thread object.
Definition: types.h:64
L4_thread_ops
Operations on thread objects.
Definition: thread.h:622
@ L4_THREAD_OPCODE_MASK
Mask for opcodes.
Definition: thread.h:636
@ L4_THREAD_AMD64_GET_SEGMENT_INFO_OP
Get segment information.
Definition: thread.h:635
@ L4_THREAD_AMD64_SET_SEGMENT_BASE_OP
Set segment base.
Definition: thread.h:634
@ L4_THREAD_X86_GDT_OP
Gdt.
Definition: thread.h:632
@ L4_THREAD_EX_REGS_OP
Exchange registers operation.
Definition: thread.h:624
@ L4_THREAD_STATS_OP
Thread statistics.
Definition: thread.h:626
@ L4_THREAD_VCPU_CONTROL_OP
Enable / disable VCPU feature.
Definition: thread.h:630
@ L4_THREAD_MODIFY_SENDER_OP
Modify all senders IDs that match the given pattern.
Definition: thread.h:629
@ L4_THREAD_CONTROL_OP
Control operation.
Definition: thread.h:623
@ L4_THREAD_ARM_TPIDRURO_OP
Set TPIDRURO register.
Definition: thread.h:633
@ L4_THREAD_VCPU_RESUME_OP
VCPU resume.
Definition: thread.h:627
@ L4_THREAD_REGISTER_DELETE_IRQ_OP
Register an IPC-gate deletion IRQ.
Definition: thread.h:628
@ L4_THREAD_SWITCH_OP
Do a thread switch.
Definition: thread.h:625
l4_msgtag_t l4_thread_modify_sender_start(void) L4_NOTHROW
Start a thread sender modification sequence.
Definition: thread.h:1012
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 or disable the extended vCPU feature for the thread.
Definition: thread.h:961
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:838
L4_thread_ex_regs_flags
Flags for the thread ex-regs operation.
Definition: thread.h:688
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:1018
l4_msgtag_t l4_thread_vcpu_control_ext(l4_cap_idx_t thread, l4_addr_t ext_vcpu_state) L4_NOTHROW
Enable or disable the extended vCPU feature for the thread.
Definition: thread.h:971
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:711
l4_msgtag_t l4_thread_yield(void) L4_NOTHROW
Yield current time slice.
Definition: thread.h:787
l4_msgtag_t l4_thread_vcpu_resume_start(void) L4_NOTHROW
vCPU return from event handler.
Definition: thread.h:913
L4_thread_control_flags
Flags for the thread control operation.
Definition: thread.h:650
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:845
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:907
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 or disable the vCPU feature for the thread.
Definition: thread.h:946
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:700
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:939
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:919
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:1029
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:898
l4_msgtag_t l4_thread_vcpu_control(l4_cap_idx_t thread, l4_addr_t vcpu_state) L4_NOTHROW
Enable or disable the vCPU feature for the thread.
Definition: thread.h:956
L4_thread_control_mr_indices
Indices for the values in the message register for thread control.
Definition: thread.h:673
@ L4_THREAD_EX_REGS_CANCEL
Cancel ongoing IPC in the thread.
Definition: thread.h:689
@ L4_THREAD_EX_REGS_TRIGGER_EXCEPTION
Trigger artificial exception in thread.
Definition: thread.h:690
@ L4_THREAD_CONTROL_SET_PAGER
The pager will be given.
Definition: thread.h:652
@ L4_THREAD_CONTROL_BIND_TASK
The task to bind the thread to will be given.
Definition: thread.h:654
@ L4_THREAD_CONTROL_UX_NATIVE
Fiasco-UX only: pass-through of host system calls is set.
Definition: thread.h:658
@ L4_THREAD_CONTROL_ALIEN
Alien state of the thread is set.
Definition: thread.h:656
@ L4_THREAD_CONTROL_SET_EXC_HANDLER
The exception handler of the thread will be given.
Definition: thread.h:660
@ L4_THREAD_CONTROL_MR_IDX_FLAG_VALS
Index for feature values.
Definition: thread.h:677
@ L4_THREAD_CONTROL_MR_IDX_PAGER
Index for pager cap.
Definition: thread.h:675
@ L4_THREAD_CONTROL_MR_IDX_BIND_TASK
Index for task flex-page for bind.
Definition: thread.h:679
@ L4_THREAD_CONTROL_MR_IDX_EXC_HANDLER
Index for exception handler.
Definition: thread.h:676
@ L4_THREAD_CONTROL_MR_IDX_FLAGS
Definition: thread.h:674
@ L4_THREAD_CONTROL_MR_IDX_BIND_UTCB
Index for UTCB address for bind.
Definition: thread.h:678
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:871
l4_msgtag_t l4_thread_control_commit(l4_cap_idx_t thread) L4_NOTHROW
Commit the thread control parameters.
Definition: thread.h:889
void l4_thread_control_alien(int on) L4_NOTHROW
Enable alien mode.
Definition: thread.h:877
void l4_thread_control_exc_handler(l4_cap_idx_t exc_handler) L4_NOTHROW
Set the exception handler.
Definition: thread.h:864
void l4_thread_control_start(void) L4_NOTHROW
Start a thread control API sequence.
Definition: thread.h:852
void l4_thread_control_ux_host_syscall(int on) L4_NOTHROW
Enable pass through of native host (Linux) system calls.
Definition: thread.h:883
void l4_thread_control_pager(l4_cap_idx_t pager) L4_NOTHROW
Set the pager.
Definition: thread.h:858
unsigned l4_utcb_mr64_idx(unsigned idx) L4_NOTHROW
Get index into 64bit message registers alias from native-sized index.
Definition: utcb.h:386
@ L4_UTCB_GENERIC_DATA_SIZE
Total number of message register (MRs) available.
Definition: utcb.h:47
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition: utcb.h:67
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition: utcb.h:340
Common L4 ABI Data Types.
Message tag data structure.
Definition: types.h:160
l4_umword_t raw
Raw value.
Definition: __l4_fpage.h:85
Encapsulation of the message-register block in the UTCB.
Definition: utcb.h:79
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition: utcb.h:80
l4_uint64_t mr64[L4_UTCB_GENERIC_DATA_SIZE/(sizeof(l4_uint64_t)/sizeof(l4_umword_t))]
Message registers 64bit alias.
Definition: utcb.h:81