L4Re – L4 Runtime Environment
|
C++ L4 kernel thread interface. More...
Data Structures | |
class | Attr |
Thread attributes used for control_commit(). More... | |
class | Modify_senders |
Wrapper class for modifying senders. More... | |
Public Member Functions | |
l4_msgtag_t | ex_regs (l4_addr_t ip, l4_addr_t sp, l4_umword_t flags, l4_utcb_t *utcb=l4_utcb()) noexcept |
Exchange basic thread registers. More... | |
l4_msgtag_t | ex_regs (l4_addr_t *ip, l4_addr_t *sp, l4_umword_t *flags, l4_utcb_t *utcb=l4_utcb()) noexcept |
Exchange basic thread registers and return previous values. More... | |
l4_msgtag_t | control (Attr const &attr) noexcept |
Commit the given thread-attributes object. More... | |
l4_msgtag_t | switch_to (l4_utcb_t *utcb=l4_utcb()) noexcept |
Switch execution to this thread. More... | |
l4_msgtag_t | stats_time (l4_kernel_clock_t *us, l4_utcb_t *utcb=l4_utcb()) noexcept |
Get consumed time of thread in us. More... | |
l4_msgtag_t | vcpu_resume_start (l4_utcb_t *utcb=l4_utcb()) noexcept |
vCPU resume, start. More... | |
l4_msgtag_t | vcpu_resume_commit (l4_msgtag_t tag, l4_utcb_t *utcb=l4_utcb()) noexcept |
vCPU resume, commit. More... | |
l4_msgtag_t | vcpu_control (l4_addr_t vcpu_state, l4_utcb_t *utcb=l4_utcb()) noexcept |
Enable or disable the vCPU feature for the thread. More... | |
l4_msgtag_t | vcpu_control_ext (l4_addr_t ext_vcpu_state, l4_utcb_t *utcb=l4_utcb()) noexcept |
Enable or disable the extended vCPU feature for the thread. More... | |
l4_msgtag_t | register_del_irq (Cap< Irq > irq, l4_utcb_t *u=l4_utcb()) noexcept |
Register an IRQ that will trigger upon deletion events. More... | |
l4_msgtag_t | modify_senders (Modify_senders const &todo) noexcept |
Apply sender modification rules. More... | |
![]() | |
l4_msgtag_t | dec_refcnt (l4_mword_t diff, l4_utcb_t *utcb=l4_utcb()) |
Decrement the in kernel reference counter for the object. More... | |
Additional Inherited Members | |
![]() | |
typedef Thread | Class |
The target interface type (inheriting from Kobject_t) | |
typedef Typeid::Iface< PROTO, Thread > | __Iface |
The interface description for the derived class. | |
typedef Typeid::Merge_list< Typeid::Iface_list< __Iface >, typename Base::__Iface_list > | __Iface_list |
The list of all RPC interfaces provided directly or through inheritance. | |
![]() | |
L4::Cap< Class > | c () const noexcept |
Get the capability to ourselves. | |
![]() | |
l4_cap_idx_t | cap () const noexcept |
Return capability selector. More... | |
![]() | |
static void | __check_protocols__ () noexcept |
Helper to check for protocol conflicts. | |
C++ L4 kernel thread interface.
The Thread class defines a thread of execution in the L4 context. Usually user-level and kernel threads are mapped 1:1 to each other. Thread kernel objects are created using a factory, see the L4::Factory API (L4::Factory::create()).
Amongst other things an L4::Thread encapsulates:
Thread objects provide an API for
For the C interface see the Thread API.
|
inlinenoexcept |
|
inlinenoexcept |
Exchange basic thread registers and return previous values.
[in,out] | ip | New instruction pointer, use ~0UL to leave the instruction pointer unchanged, return previous instruction pointer. |
[in,out] | sp | New stack pointer, use ~0UL to leave the stack pointer unchanged, returns previous stack pointer. |
[in,out] | flags | Ex-regs flags, see L4_thread_ex_regs_flags, return previous CPU flags of the thread. |
utcb | UTCB to use for this operation. |
This method allows to manipulate and start a thread. The basic functionality is to set the instruction pointer and the stack pointer of a thread. Additionally, this method allows also to cancel ongoing IPC operations and to force the thread to raise an artificial exception (see flags
).
Definition at line 111 of file thread.
References L4::Kobject::cap(), and l4_thread_ex_regs_ret_u().
|
inlinenoexcept |
Exchange basic thread registers.
ip | New instruction pointer, use ~0UL to leave the instruction pointer unchanged. |
sp | New stack pointer, use ~0UL to leave the stack pointer unchanged. |
flags | Ex-regs flags, see L4_thread_ex_regs_flags. |
utcb | UTCB to use for this operation. |
This method allows to manipulate a thread. The basic functionality is to set the instruction pointer and the stack pointer of a thread. Additionally, this method allows also to cancel ongoing IPC operations and to force the thread to raise an artificial exception (see flags
).
The thread is started using L4::Scheduler::run_thread(). However, if at the time L4::Scheduler::run_thread() is called, the instruction pointer of the thread is invalid, a later call to ex_regs() with a valid instruction pointer might start the thread.
Definition at line 85 of file thread.
References L4::Kobject::cap(), and l4_thread_ex_regs_u().
|
inlinenoexcept |
Apply sender modification rules.
todo | Prepared sender modification rules. |
The modification rules are applied to all IPCs to the thread (whether directly or by IPC gate) that are already in flight, that is that the sender is already blocking on.
Definition at line 394 of file thread.
References L4::Kobject::cap(), l4_ipc_call(), l4_msgtag(), and L4_PROTO_THREAD.
Referenced by L4Re::Util::Object_registry::unregister_obj().
|
inlinenoexcept |
Register an IRQ that will trigger upon deletion events.
irq | Capability selector for the IRQ object to be triggered. |
u | UTCB to be used for this operation, usually the UTCB of the calling thread. |
An example of a deletion event is the removal of an IPC gate that is bound to this thread.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Enable or disable the vCPU feature for the thread.
vcpu_state | The virtual address where the kernel shall store the vCPU state in case of vCPU exits. The address must be a valid kernel-user-memory address (see L4::Task::add_ku_mem()). |
utcb | UTCB to use for this operation. |
This function enables the vCPU feature of this
thread if vcpu_state
is set to a valid kernel-user-memory address, or disables the vCPU feature if vcpu_state
is 0. (Disable: optional, currently unsupported.)
Definition at line 283 of file thread.
References L4::Kobject::cap(), and l4_thread_vcpu_control_u().
|
inlinenoexcept |
Enable or disable the extended vCPU feature for the thread.
ext_vcpu_state | The virtual address where the kernel shall store the vCPU state in case of vCPU exits. The address must be a valid kernel-user-memory address (see L4::Task::add_ku_mem()). |
utcb | UTCB to use for this operation. |
The extended vCPU feature allows the use of hardware-virtualization features such as Intel's VT or AMD's SVM.
This function enables the extended vCPU feature of this
thread if ext_vcpu_state
is set to a valid kernel-user-memory address, or disables the vCPU feature if ext_vcpu_state
is 0.
Definition at line 307 of file thread.
References L4::Kobject::cap(), and l4_thread_vcpu_control_ext_u().
|
inlinenoexcept |
|
inlinenoexcept |