|
l4_msgtag_t | ex_regs (l4_addr_t ip, l4_addr_t sp, l4_umword_t flags, l4_utcb_t *utcb=l4_utcb()) throw () |
| 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()) throw () |
| Exchange basic thread registers and return previous values. More...
|
|
l4_msgtag_t | control (Attr const &attr) throw () |
| Commit the given thread-attributes object. More...
|
|
l4_msgtag_t | switch_to (l4_utcb_t *utcb=l4_utcb()) throw () |
| Switch execution to this thread. More...
|
|
l4_msgtag_t | stats_time (l4_kernel_clock_t *us, l4_utcb_t *utcb=l4_utcb()) throw () |
| Get consumed time of thread in us. More...
|
|
l4_msgtag_t | vcpu_resume_start (l4_utcb_t *utcb=l4_utcb()) throw () |
| vCPU resume, start. More...
|
|
l4_msgtag_t | vcpu_resume_commit (l4_msgtag_t tag, l4_utcb_t *utcb=l4_utcb()) throw () |
| vCPU resume, commit. More...
|
|
l4_msgtag_t | vcpu_control (l4_addr_t vcpu_state, l4_utcb_t *utcb=l4_utcb()) throw () |
| 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()) throw () |
| 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()) throw () |
| Register an IRQ that will trigger upon deletion events. More...
|
|
l4_msgtag_t | modify_senders (Modify_senders const &todo) throw () |
| 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...
|
|
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:
- CPU state
- General-purpose registers
- Program counter
- Stack pointer
- FPU state
- Scheduling parameters, see the L4::Scheduler API
- Execution state
- Blocked, Runnable, Running
Thread objects provide an API for
- Include File
For the C interface see the Thread API.
Definition at line 58 of file thread.
Exchange basic thread registers.
- Parameters
-
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. |
- Returns
- System call return tag
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().
Exchange basic thread registers and return previous values.
- Parameters
-
[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. |
- Returns
- System call return tag. [out] parameters are only valid if the function returns successfully. Use l4_error() to check.
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().
Enable or disable the vCPU feature for the thread.
- Parameters
-
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. |
- Returns
- Syscall return tag.
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 272 of file thread.
References L4::Kobject::cap(), and l4_thread_vcpu_control_u().
Enable or disable the extended vCPU feature for the thread.
- Parameters
-
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. |
- Returns
- Syscall return tag.
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.
- Note
- The extended vCPU mode includes the normal vCPU mode.
Definition at line 296 of file thread.
References L4::Kobject::cap(), and l4_thread_vcpu_control_ext_u().