L4Re Operating System Framework
Interface and Usage Documentation
|
C++ interface of the initial environment that is provided to an L4 task. More...
#include <env>
Public Types | |
typedef l4re_env_cap_entry_t | Cap_entry |
C++ type for an entry in the initial objects array. | |
Public Member Functions | |
L4::Cap< Parent > | parent () const noexcept |
Object-capability to the parent. | |
L4::Cap< Mem_alloc > | mem_alloc () const noexcept |
Object-capability to the memory allocator. | |
L4::Cap< L4::Factory > | user_factory () const noexcept |
Object-capability to the user-level object factory. | |
L4::Cap< Rm > | rm () const noexcept |
Object-capability to the region map. | |
L4::Cap< Log > | log () const noexcept |
Object-capability to the logging service. | |
L4::Cap< L4::Thread > | main_thread () const noexcept |
Object-capability of the first user thread. | |
L4::Cap< L4::Task > | task () const noexcept |
Object-capability of the user task. | |
L4::Cap< L4::Factory > | factory () const noexcept |
Object-capability to the factory object available to the task. | |
l4_cap_idx_t | first_free_cap () const noexcept |
First available capability selector. | |
l4_fpage_t | utcb_area () const noexcept |
UTCB area of the task. | |
l4_addr_t | first_free_utcb () const noexcept |
First free UTCB. | |
Cap_entry const * | initial_caps () const noexcept |
Get a pointer to the first entry in the initial objects array. | |
Cap_entry const * | get (char const *name, unsigned l) const noexcept |
Get the Cap_entry for the object named name. | |
template<typename T > | |
L4::Cap< T > | get_cap (char const *name, unsigned l) const noexcept |
Get the capability selector for the object named name. | |
template<typename T > | |
L4::Cap< T > | get_cap (char const *name) const noexcept |
Get the capability selector for the object named name. | |
void | parent (L4::Cap< Parent > const &c) noexcept |
Set parent object-capability. | |
void | mem_alloc (L4::Cap< Mem_alloc > const &c) noexcept |
Set memory allocator object-capability. | |
void | rm (L4::Cap< Rm > const &c) noexcept |
Set region map object-capability. | |
void | log (L4::Cap< Log > const &c) noexcept |
Set log object-capability. | |
void | main_thread (L4::Cap< L4::Thread > const &c) noexcept |
Set object-capability of first user thread. | |
void | factory (L4::Cap< L4::Factory > const &c) noexcept |
Set factory object-capability. | |
void | first_free_cap (l4_cap_idx_t c) noexcept |
Set first available capability selector. | |
void | utcb_area (l4_fpage_t utcbs) noexcept |
Set UTCB area of the task. | |
void | first_free_utcb (l4_addr_t u) noexcept |
Set first free UTCB. | |
L4::Cap< L4::Scheduler > | scheduler () const noexcept |
Get the scheduler capability for the task. | |
void | scheduler (L4::Cap< L4::Scheduler > const &c) noexcept |
Set the scheduler capability. | |
void | initial_caps (Cap_entry *first) noexcept |
Set the pointer to the first Cap_entry in the initial objects array. | |
Static Public Member Functions | |
static Env const * | env () noexcept |
Returns the initial environment for the current task. | |
C++ interface of the initial environment that is provided to an L4 task.
The initial environment is provided to each L4 task that is started by an L4Re conform loader, such as the Moe root task. The initial environment provides access to a set of initial capabilities and some additional information about the available resources, such as free UTCBs (see Virtual Registers ) and available entries in capability table (provided by the micro kernel).
Each of the initial capabilities is stored at a fixed index in the task's capability table and the L4 runtime environment provides convenience functions to retrieve the capabilities. See the table below for an comprehensive overview.
Name | Object Type | Convenience Function |
---|---|---|
parent | L4Re::Parent | L4Re::Env::parent() |
user_factory | L4::Factory | L4Re::Env::user_factory() |
log | L4Re::Log | L4Re::Env::log() |
main_thread | L4::Thread | L4Re::Env::main_thread() |
rm | L4Re::Rm | L4Re::Env::rm() |
factory | L4::Factory | L4Re::Env::factory() |
task | L4::Task | L4Re::Env::task() |
scheduler | L4::Scheduler | L4Re::Env::scheduler() |
Additional information found in the initial environment is:
For an explanation of the default task capabilites see l4_default_caps_t.
For the C interface refer to Initial Environment.
|
inlinestaticnoexcept |
Returns the initial environment for the current task.
A typical use of this function is L4Re::Env::env()-><member>()
Definition at line 103 of file env.
Referenced by L4virtio::Svr::Dev_config::Dev_config(), L4virtio::Driver::Device::driver_connect(), L4virtio::Driver::Virtio_net_device::setup_device(), and L4virtio::Driver::Block_device::setup_device().
|
inlinenoexcept |
Object-capability to the factory object available to the task.
Definition at line 151 of file env.
References l4re_env_t::factory.
|
inlinenoexcept |
Set factory object-capability.
c | Factory object-capability |
Definition at line 256 of file env.
References l4re_env_t::factory.
|
inlinenoexcept |
First available capability selector.
First capability selector available for use for in the application.
Definition at line 159 of file env.
References l4re_env_t::first_free_cap.
|
inlinenoexcept |
Set first available capability selector.
c | First capability selector available to the application. |
Definition at line 262 of file env.
References l4re_env_t::first_free_cap.
|
inlinenoexcept |
First free UTCB.
First free UTCB within the UTCB area available for the application to use.
Definition at line 174 of file env.
References l4re_env_t::first_free_utcb.
|
inlinenoexcept |
Set first free UTCB.
u | First UTCB available for the application to use. |
Definition at line 274 of file env.
References l4re_env_t::first_free_utcb.
|
inlinenoexcept |
Get the Cap_entry for the object named name.
name | is the name of the object. |
l | is the length of the name, thus name might not be zero terminated. |
Definition at line 192 of file env.
References l4re_env_get_cap_l().
|
inlinenoexcept |
|
inlinenoexcept |
Get the capability selector for the object named name.
name | is the name of the object. |
l | is the length of the name, thus name might not be zero terminated. |
Definition at line 204 of file env.
References L4_ENOENT.
|
inlinenoexcept |
Get a pointer to the first entry in the initial objects array.
Definition at line 181 of file env.
References l4re_env_t::caps.
|
inlinenoexcept |
Set the pointer to the first Cap_entry in the initial objects array.
first | is the first element in the array. |
Definition at line 296 of file env.
References l4re_env_t::caps.
Object-capability to the logging service.
Definition at line 133 of file env.
References l4re_env_t::log.
Set log object-capability.
c | Log object-capability |
Definition at line 244 of file env.
References l4re_env_t::log.
|
inlinenoexcept |
Object-capability of the first user thread.
Definition at line 139 of file env.
References l4re_env_t::main_thread.
|
inlinenoexcept |
Set object-capability of first user thread.
c | First thread's object-capability |
Definition at line 250 of file env.
References l4re_env_t::main_thread.
Object-capability to the memory allocator.
Definition at line 116 of file env.
References l4re_env_t::mem_alloc.
Set memory allocator object-capability.
c | Memory allocator object-capability |
Definition at line 232 of file env.
References l4re_env_t::mem_alloc.
Object-capability to the parent.
Definition at line 110 of file env.
References l4re_env_t::parent.
Set parent object-capability.
c | Parent object-capability |
Definition at line 226 of file env.
References l4re_env_t::parent.
Object-capability to the region map.
Definition at line 127 of file env.
References l4re_env_t::rm.
Set region map object-capability.
c | Region map object-capability |
Definition at line 238 of file env.
References l4re_env_t::rm.
|
inlinenoexcept |
Get the scheduler capability for the task.
Definition at line 282 of file env.
References l4re_env_t::scheduler.
|
inlinenoexcept |
Set the scheduler capability.
c | is the capability to be set as scheduler. |
Definition at line 289 of file env.
References l4re_env_t::scheduler.
|
inlinenoexcept |
UTCB area of the task.
Definition at line 165 of file env.
References l4re_env_t::utcb_area.
|
inlinenoexcept |
Set UTCB area of the task.
utcbs | UTCB area |
Definition at line 268 of file env.
References l4re_env_t::utcb_area.