Thread attributes used for control().
More...
#include <thread>
|
| Attr (l4_utcb_t *utcb=l4_utcb()) noexcept |
| Create a thread-attribute object with the given UTCB.
|
|
void | pager (Cap< void > const &pager) noexcept |
| Set the pager capability selector.
|
|
Cap< void > | pager () noexcept |
| Get the capability selector used for page-fault messages.
|
|
void | exc_handler (Cap< void > const &exc_handler) noexcept |
| Set the exception-handler capability selector.
|
|
Cap< void > | exc_handler () noexcept |
| Get the capability selector used for exception messages.
|
|
void | bind (l4_utcb_t *thread_utcb, Cap< Task > const &task) noexcept |
| Bind the thread to a task.
|
|
void | alien (int on) noexcept |
| Enable alien mode.
|
|
void | ux_host_syscall (int on) noexcept |
| Allow host system calls on Fiasco-UX.
|
|
Thread attributes used for control().
This class is responsible for initializing various attributes of a thread in a UTCB for the control() method.
- Note
- Instantiation of this class starts the preparation of the UTCB. Do not invoke any non-Attr functions between the instantiation and the call to L4::Thread::control().
- See also
- Thread control for some more details.
Definition at line 141 of file thread.
◆ Attr()
Create a thread-attribute object with the given UTCB.
- Parameters
-
Definition at line 155 of file thread.
◆ alien()
void L4::Thread::Attr::alien |
( |
int |
on | ) |
|
|
inlinenoexcept |
Enable alien mode.
- Parameters
-
on | Boolean value defining the state of the feature. |
For a thread in alien mode the kernel produces just an exception IPC for each IPC and exception caused by the alien thread instead of handling these events regularly. (Page faults of alien threads and interrupts occuring while the alien thread is running are always handled regularly.) While the alien thread is blocking, the execption handler can inspect and modify the state of the alien thread and potentially also the systemcall arguments. If the exception handler replies with L4_PROTO_ALLOW_SYSCALL as message tag, the kernel handles the next IPC or exception of the alien thread in a regular way. If the exception handler leaves certain thread state unchanged (in particular the instruction pointer), this will be the IPC or exception that caused the call of the exception handler. For a regularly processed IPC or exception of the alien thread the kernel also performs an exception IPC on kernel exit.
This feature can be used to attach a debugger to a thread and trace all object invocations and their results. It could also be used to handle other systems that use the same syscall instruction as L4Re.
Definition at line 223 of file thread.
◆ bind()
void L4::Thread::Attr::bind |
( |
l4_utcb_t * |
thread_utcb, |
|
|
Cap< Task > const & |
task |
|
) |
| |
|
inlinenoexcept |
Bind the thread to a task.
- Parameters
-
thread_utcb | The thread’s UTCB address within the task it shall be bound to. The address must be aligned (architecture dependent; at least word aligned) and it must point to at least L4_UTCB_OFFSET bytes of kernel-user memory. |
task | The task the thread shall be bound to. |
- Precondition
- The thread must not be bound to a task yet.
A thread may execute code in the context of a task if and only if the thread is bound to the task. To actually start execution, L4::Thread::ex_regs() needs to be used. Execution in the context of the task means that the code has access to all the task’s resources (and only those). The executed code itself must be one of those resources. A thread can be bound at most once to a task.
- Note
- The UTCBs of different threads in the same task should not overlap in order to prevent data corruption.
Definition at line 217 of file thread.
◆ exc_handler() [1/2]
Cap< void > L4::Thread::Attr::exc_handler |
( |
| ) |
|
|
inlinenoexcept |
Get the capability selector used for exception messages.
- Returns
- The capability selector used to send exception messages. The selector is valid in the task the thread is bound to.
Definition at line 193 of file thread.
Referenced by exc_handler().
◆ exc_handler() [2/2]
void L4::Thread::Attr::exc_handler |
( |
Cap< void > const & |
exc_handler | ) |
|
|
inlinenoexcept |
Set the exception-handler capability selector.
- Parameters
-
exc_handler | The capability selector that shall be used for exception messages. This capability selector must be valid within the task the thread is bound to. |
Definition at line 184 of file thread.
References exc_handler().
◆ pager() [1/2]
Cap< void > L4::Thread::Attr::pager |
( |
| ) |
|
|
inlinenoexcept |
Get the capability selector used for page-fault messages.
- Returns
- The capability selector used to send page-fault messages. The selector is valid in the task the thread is bound to.
Definition at line 174 of file thread.
Referenced by pager().
◆ pager() [2/2]
void L4::Thread::Attr::pager |
( |
Cap< void > const & |
pager | ) |
|
|
inlinenoexcept |
Set the pager capability selector.
- Parameters
-
pager | The capability selector that shall be used for page-fault messages. This capability selector must be valid within the task the thread is bound to. |
Definition at line 165 of file thread.
References pager().
◆ ux_host_syscall()
void L4::Thread::Attr::ux_host_syscall |
( |
int |
on | ) |
|
|
inlinenoexcept |
Allow host system calls on Fiasco-UX.
- Precondition
- Running on Fiasco-UX.
Definition at line 231 of file thread.
The documentation for this class was generated from the following file: