L4Re - L4 Runtime Environment
|
C++ interface of the initial environment that is provided to an L4 task. More...
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 throw () |
Object-capability to the parent. More... | |
L4::Cap< Mem_alloc > | mem_alloc () const throw () |
Object-capability to the memory allocator. More... | |
L4::Cap< L4::Factory > | user_factory () const throw () |
Object-capability to the user-level object factory. | |
L4::Cap< Rm > | rm () const throw () |
Object-capability to the region map. More... | |
L4::Cap< Log > | log () const throw () |
Object-capability to the logging service. More... | |
L4::Cap< L4::Thread > | main_thread () const throw () |
Object-capability of the first user thread. More... | |
L4::Cap< L4::Task > | task () const throw () |
Object-capability of the user task. More... | |
L4::Cap< L4::Factory > | factory () const throw () |
Object-capability to the factory object available to the task. More... | |
l4_cap_idx_t | first_free_cap () const throw () |
First available capability selector. More... | |
l4_fpage_t | utcb_area () const throw () |
UTCB area of the task. More... | |
l4_addr_t | first_free_utcb () const throw () |
First free UTCB. More... | |
Cap_entry const * | initial_caps () const throw () |
Get a pointer to the first entry in the initial objects array. More... | |
Cap_entry const * | get (char const *name, unsigned l) const throw () |
Get the Cap_entry for the object named name. More... | |
template<typename T > | |
L4::Cap< T > | get_cap (char const *name, unsigned l) const throw () |
Get the capability selector for the object named name. More... | |
template<typename T > | |
L4::Cap< T > | get_cap (char const *name) const throw () |
Get the capability selector for the object named name. More... | |
void | parent (L4::Cap< Parent > const &c) throw () |
Set parent object-capability. More... | |
void | mem_alloc (L4::Cap< Mem_alloc > const &c) throw () |
Set memory allocator object-capability. More... | |
void | rm (L4::Cap< Rm > const &c) throw () |
Set region map object-capability. More... | |
void | log (L4::Cap< Log > const &c) throw () |
Set log object-capability. More... | |
void | main_thread (L4::Cap< L4::Thread > const &c) throw () |
Set object-capability of first user thread. More... | |
void | factory (L4::Cap< L4::Factory > const &c) throw () |
Set factory object-capability. More... | |
void | first_free_cap (l4_cap_idx_t c) throw () |
Set first available capability selector. More... | |
void | utcb_area (l4_fpage_t utcbs) throw () |
Set UTCB area of the task. More... | |
void | first_free_utcb (l4_addr_t u) throw () |
Set first free UTCB. More... | |
L4::Cap< L4::Scheduler > | scheduler () const throw () |
Get the scheduler capability for the task. More... | |
void | scheduler (L4::Cap< L4::Scheduler > const &c) throw () |
Set the scheduler capability. More... | |
void | initial_caps (Cap_entry *first) throw () |
Set the pointer to the first Cap_entry in the initial objects array. More... | |
Static Public Member Functions | |
static Env const * | env () throw () |
Returns the initial environment for the current task. More... | |
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 the C interface refer to Initial Environment.
|
inlinestatic |
Returns the initial environment for the current task.
A typical use of this function is L4Re::Env::env()-><member>()
Definition at line 100 of file env.
Referenced by L4virtio::Svr::Dev_config::Dev_config(), L4vcpu::Vcpu::entry_ip(), and L4Re::Util::Object_registry::Object_registry().
|
inline |
Object-capability to the factory object available to the task.
Definition at line 148 of file env.
References l4re_env_t::factory.
|
inline |
Set factory object-capability.
c | Factory object-capability |
Definition at line 253 of file env.
References l4re_env_t::factory.
|
inline |
First available capability selector.
First capability selector available for use for in the application.
Definition at line 156 of file env.
References l4re_env_t::first_free_cap.
|
inline |
Set first available capability selector.
c | First capability selector available to the application. |
Definition at line 259 of file env.
References l4re_env_t::first_free_cap.
|
inline |
First free UTCB.
First free UTCB within the UTCB area available for the application to use.
Definition at line 171 of file env.
References l4re_env_t::first_free_utcb.
|
inline |
Set first free UTCB.
u | First UTCB available for the application to use. |
Definition at line 271 of file env.
References l4re_env_t::first_free_utcb.
|
inline |
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 189 of file env.
References l4re_env_get_cap_l().
|
inline |
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 201 of file env.
References L4_ENOENT.
Referenced by L4Re::Util::Object_registry::Object_registry().
|
inline |
|
inline |
|
inline |
Object-capability to the logging service.
Definition at line 130 of file env.
References l4re_env_t::log.
Set log object-capability.
c | Log object-capability |
Definition at line 241 of file env.
References l4re_env_t::log.
|
inline |
Object-capability of the first user thread.
Definition at line 136 of file env.
References l4re_env_t::main_thread.
|
inline |
Set object-capability of first user thread.
c | First thread's object-capability |
Definition at line 247 of file env.
References l4re_env_t::main_thread.
Object-capability to the memory allocator.
Definition at line 113 of file env.
References l4re_env_t::mem_alloc.
Set memory allocator object-capability.
c | Memory allocator object-capability |
Definition at line 229 of file env.
References l4re_env_t::mem_alloc.
Object-capability to the parent.
Definition at line 107 of file env.
References l4re_env_t::parent.
Set parent object-capability.
c | Parent object-capability |
Definition at line 223 of file env.
References l4re_env_t::parent.
Object-capability to the region map.
Definition at line 124 of file env.
References l4re_env_t::rm.
Set region map object-capability.
c | Region map object-capability |
Definition at line 235 of file env.
References l4re_env_t::rm.
|
inline |
Get the scheduler capability for the task.
Definition at line 279 of file env.
References l4re_env_t::scheduler.
|
inline |
Set the scheduler capability.
c | is the capability to be set as scheduler. |
Definition at line 286 of file env.
References l4re_env_t::scheduler.
|
inline |
UTCB area of the task.
Definition at line 162 of file env.
References l4re_env_t::utcb_area.
|
inline |
Set UTCB area of the task.
utcbs | UTCB area |
Definition at line 265 of file env.
References l4re_env_t::utcb_area.