L4Re – L4 Runtime Environment
L4::Thread::Attr Class Reference

Thread attributes used for control_commit(). More...

+ Collaboration diagram for L4::Thread::Attr:

Public Member Functions

 Attr (l4_utcb_t *utcb=l4_utcb()) noexcept
 Create a thread-attribute object with the given UTCB. More...
 
void pager (Cap< void > const &pager) noexcept
 Set the pager capability selector. More...
 
Cap< void > pager () noexcept
 Get the capability selector used for page-fault messages. More...
 
void exc_handler (Cap< void > const &exc_handler) noexcept
 Set the exception-handler capability selector. More...
 
Cap< void > exc_handler () noexcept
 Get the capability selector used for exception messages. More...
 
void bind (l4_utcb_t *thread_utcb, Cap< Task > const &task) noexcept
 Bind the thread to a task. More...
 
void alien (int on) noexcept
 Set the thread to alien mode.
 
void ux_host_syscall (int on) noexcept
 Allow host system calls on Fiasco-UX. More...
 

Friends

class L4::Thread
 

Detailed Description

Thread attributes used for control_commit().

This class is responsible for initializing various attributes of a thread in a UTCB for the control_commit() 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 129 of file thread.

Constructor & Destructor Documentation

◆ Attr()

L4::Thread::Attr::Attr ( l4_utcb_t utcb = l4_utcb())
inlineexplicitnoexcept

Create a thread-attribute object with the given UTCB.

Parameters
utcbThe UTCB to use for the later L4::Thread::control_commit() function. Usually this is the UTCB of the calling thread.

Definition at line 142 of file thread.

Member Function Documentation

◆ bind()

void L4::Thread::Attr::bind ( l4_utcb_t thread_utcb,
Cap< Task > const &  task 
)
inlinenoexcept

Bind the thread to a task.

Parameters
thread_utcbThe 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.
taskThe task the thread shall be bound to.

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.

Note
The UTCBs of different threads in the same task should not overlap in order to prevent data corruption.

Definition at line 202 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 180 of file thread.

◆ exc_handler() [2/2]

void L4::Thread::Attr::exc_handler ( Cap< void > const &  exc_handler)
inlinenoexcept

Set the exception-handler capability selector.

Parameters
exc_handlerThe 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 171 of file thread.

◆ 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 161 of file thread.

◆ pager() [2/2]

void L4::Thread::Attr::pager ( Cap< void > const &  pager)
inlinenoexcept

Set the pager capability selector.

Parameters
pagerThe 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 152 of file thread.

◆ 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 216 of file thread.


The documentation for this class was generated from the following file: