L4Re - L4 Runtime Environment
L4Re Namespace Reference

L4Re C++ Interfaces. More...

Namespaces

 Util
 Documentation of the L4 Runtime Environment utility functionality in C++.
 
 Vfs
 Virtual file system for interfaces POSIX libc.
 

Data Structures

class  Cap_alloc
 Capability allocator interface. More...
 
class  Console
 Console class. More...
 
class  Dataspace
 Interface for memory-like objects. More...
 
class  Debug_obj
 Debug interface. More...
 
class  Dma_space
 DMA Address Space. More...
 
class  Env
 C++ interface of the initial environment that is provided to an L4 task. More...
 
class  Event
 Event class. More...
 
class  Event_buffer_t
 Event buffer class. More...
 
class  Inhibitor
 Set of inhibitor locks, which inhibit specific actions when held. More...
 
class  Log
 Log interface class. More...
 
class  Mem_alloc
 Memory allocation interface. More...
 
struct  Mmio_space
 Interface for memory-like address space accessible via IPC. More...
 
class  Namespace
 Name-space interface. More...
 
class  Parent
 Parent interface. More...
 
class  Rm
 Region map. More...
 
class  Smart_cap_auto
 Helper for Auto_cap and Auto_del_cap. More...
 
class  Smart_count_cap
 Helper for Ref_cap and Ref_del_cap. More...
 

Typedefs

template<typename T >
using Shared_cap = L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_ALL_SPACES > >
 Shared capability that implements automatic free and unmap of the capability selector. More...
 
template<typename T >
using shared_cap = L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_ALL_SPACES > >
 Shared capability that implements automatic free and unmap of the capability selector. More...
 
template<typename T >
using Shared_del_cap = L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_DELETE_OBJ > >
 Shared capability that implements automatic free and unmap+delete of the capability selector. More...
 
template<typename T >
using shared_del_cap = L4::Detail::Shared_cap_impl< T, Smart_count_cap< L4_FP_DELETE_OBJ > >
 Shared capability that implements automatic free and unmap+delete of the capability selector. More...
 
template<typename T >
using Unique_cap = L4::Detail::Unique_cap_impl< T, Smart_cap_auto< L4_FP_ALL_SPACES > >
 Unique capability that implements automatic free and unmap of the capability selector. More...
 
template<typename T >
using unique_cap = L4::Detail::Unique_cap_impl< T, Smart_cap_auto< L4_FP_ALL_SPACES > >
 Unique capability that implements automatic free and unmap of the capability selector. More...
 
template<typename T >
using Unique_del_cap = L4::Detail::Unique_cap_impl< T, Smart_cap_auto< L4_FP_DELETE_OBJ > >
 Unique capability that implements automatic free and unmap+delete of the capability selector. More...
 
template<typename T >
using unique_del_cap = L4::Detail::Unique_cap_impl< T, Smart_cap_auto< L4_FP_DELETE_OBJ > >
 Unique capability that implements automatic free and unmap+delete of the capability selector. More...
 

Functions

long chksys (long err, char const *extra="", long ret=0)
 Generate C++ exception on error. More...
 
long chksys (l4_msgtag_t const &t, char const *extra="", l4_utcb_t *utcb=l4_utcb(), long ret=0)
 Generate C++ exception on error. More...
 
long chksys (l4_msgtag_t const &t, l4_utcb_t *utcb, char const *extra="")
 Generate C++ exception on error. More...
 
template<typename T >
chkcap (T &&cap, char const *extra="", long err=-L4_ENOMEM)
 Check for valid capability or raise C++ exception. More...
 
l4_msgtag_t chkipc (l4_msgtag_t tag, char const *extra="", l4_utcb_t *utcb=l4_utcb())
 Test a message tag for IPC errors. More...
 
template<typename T >
Shared_cap< T > make_shared_cap (L4Re::Cap_alloc *ca)
 Allocate a capability slot and wrap it in a Shared_cap. More...
 
template<typename T >
Shared_del_cap< T > make_shared_del_cap (L4Re::Cap_alloc *ca)
 Allocate a capability slot and wrap it in a Shared_del_cap. More...
 
template<typename T >
Unique_cap< T > make_unique_cap (L4Re::Cap_alloc *ca)
 Allocate a capability slot and wrap it in an Unique_cap. More...
 
template<typename T >
Unique_del_cap< T > make_unique_del_cap (L4Re::Cap_alloc *ca)
 Allocate a capability slot and wrap it in an Unique_del_cap. More...
 

Detailed Description

L4Re C++ Interfaces.

L4 Runtime Environment.

Typedef Documentation

◆ Shared_cap

template<typename T >
using L4Re::Shared_cap = typedef L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_ALL_SPACES> >

Shared capability that implements automatic free and unmap of the capability selector.

Template Parameters
TType of the object the capability refers to.

This shared capability implements a counted reference to a capability selector. The capability shall be unmapped and freed when the reference count in the allocator goes to zero.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Shared_cap.

Definition at line 44 of file shared_cap.

◆ shared_cap

template<typename T >
using L4Re::shared_cap = typedef L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_ALL_SPACES> >

Shared capability that implements automatic free and unmap of the capability selector.

Template Parameters
TType of the object the capability refers to.

This shared capability implements a counted reference to a capability selector. The capability shall be unmapped and freed when the reference count in the allocator goes to zero.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Shared_cap.

Definition at line 47 of file shared_cap.

◆ Shared_del_cap

template<typename T >
using L4Re::Shared_del_cap = typedef L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_DELETE_OBJ> >

Shared capability that implements automatic free and unmap+delete of the capability selector.

Template Parameters
TType of the object the capability refers to.

This shared capability implements a counted reference to a capability selector. The capability shall be unmapped and freed when the reference count in the allocator goes to zero. The main difference to Shared_cap is that the unmap is done with the deletion flag enabled and this leads to the deletion of the object if the current task holds appropriate deletion rights.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Shared_del_cap.

Definition at line 80 of file shared_cap.

◆ shared_del_cap

template<typename T >
using L4Re::shared_del_cap = typedef L4::Detail::Shared_cap_impl<T, Smart_count_cap<L4_FP_DELETE_OBJ> >

Shared capability that implements automatic free and unmap+delete of the capability selector.

Template Parameters
TType of the object the capability refers to.

This shared capability implements a counted reference to a capability selector. The capability shall be unmapped and freed when the reference count in the allocator goes to zero. The main difference to Shared_cap is that the unmap is done with the deletion flag enabled and this leads to the deletion of the object if the current task holds appropriate deletion rights.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Shared_del_cap.

Definition at line 83 of file shared_cap.

◆ Unique_cap

template<typename T >
using L4Re::Unique_cap = typedef L4::Detail::Unique_cap_impl<T, Smart_cap_auto<L4_FP_ALL_SPACES> >

Unique capability that implements automatic free and unmap of the capability selector.

Template Parameters
TType of the object the capability refers to.

The ownership of the capability is managed in the same way as unique_ptr.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Unique_cap.

Definition at line 42 of file unique_cap.

◆ unique_cap

template<typename T >
using L4Re::unique_cap = typedef L4::Detail::Unique_cap_impl<T, Smart_cap_auto<L4_FP_ALL_SPACES> >

Unique capability that implements automatic free and unmap of the capability selector.

Template Parameters
TType of the object the capability refers to.

The ownership of the capability is managed in the same way as unique_ptr.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Unique_cap.

Definition at line 45 of file unique_cap.

◆ Unique_del_cap

template<typename T >
using L4Re::Unique_del_cap = typedef L4::Detail::Unique_cap_impl<T, Smart_cap_auto<L4_FP_DELETE_OBJ> >

Unique capability that implements automatic free and unmap+delete of the capability selector.

Template Parameters
TType of the object the capability refers to.

The main difference to Unique_cap is that the unmap is done with the deletion flag enabled and this leads to the deletion of the object if the current task holds appropriate deletion rights.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Unique_del_cap.

Definition at line 75 of file unique_cap.

◆ unique_del_cap

template<typename T >
using L4Re::unique_del_cap = typedef L4::Detail::Unique_cap_impl<T, Smart_cap_auto<L4_FP_DELETE_OBJ> >

Unique capability that implements automatic free and unmap+delete of the capability selector.

Template Parameters
TType of the object the capability refers to.

The main difference to Unique_cap is that the unmap is done with the deletion flag enabled and this leads to the deletion of the object if the current task holds appropriate deletion rights.

Note
This type is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::Unique_del_cap.

Definition at line 78 of file unique_cap.

Function Documentation

◆ chkcap()

template<typename T >
T L4Re::chkcap ( T &&  cap,
char const *  extra = "",
long  err = -L4_ENOMEM 
)
inline

Check for valid capability or raise C++ exception.

Template Parameters
TType of object to check, must be capability-like (L4::Cap, L4Re::Util::Unique_cap etc.)
Parameters
capCapability value to check.
extraOptional text for exception.
errError value for exception or 0 if the capability value should be used.

This function checks whether the capability is valid. If the capability is invalid an C++ exception is generated, using err if err is not zero, otherwise the capability value is used. A valid capability will just be returned.

Definition at line 140 of file error_helper.

◆ chkipc()

l4_msgtag_t L4Re::chkipc ( l4_msgtag_t  tag,
char const *  extra = "",
l4_utcb_t utcb = l4_utcb() 
)
inline

Test a message tag for IPC errors.

Parameters
tagMessage tag returned by the IPC.
extraException message in case of error.
utcbThe UTCB used in the IPC operation.
Returns
On IPC error an exception is thrown, otherwise tag is returned.
Exceptions
L4::Runtime_exceptionwith the translated IPC error code

This function does not check the message tag's label value.

Note
This must be called on a message tag before the UTCB is changed.

Definition at line 171 of file error_helper.

◆ chksys() [1/3]

long L4Re::chksys ( long  err,
char const *  extra = "",
long  ret = 0 
)
inline

Generate C++ exception on error.

Parameters
errError value, if negative exception will be thrown
extraOptional text for exception (default "")
retOptional value for exception, default is error value (err)

This function throws an exception if the err is negative and otherwise returns err.

Definition at line 63 of file error_helper.

◆ chksys() [2/3]

long L4Re::chksys ( l4_msgtag_t const &  t,
char const *  extra = "",
l4_utcb_t utcb = l4_utcb(),
long  ret = 0 
)
inline

Generate C++ exception on error.

Parameters
tMessage tag.
extraOptional text for exception (default "")
utcbOption UTCB
retOptional value for exception, default is error value (err)

This function throws an exception if the message tag contains an error or the label in the message tag is negative. Otherwise the label in the message tag is returned.

Definition at line 84 of file error_helper.

◆ chksys() [3/3]

long L4Re::chksys ( l4_msgtag_t const &  t,
l4_utcb_t utcb,
char const *  extra = "" 
)
inline

Generate C++ exception on error.

Parameters
tMessage tag.
utcbUTCB.
extraOptional text for exception (default "")

This function throws an exception if the message tag contains an error or the label in the message tag is negative. Otherwise the label in the message tag is returned.

Definition at line 107 of file error_helper.

◆ make_shared_cap()

template<typename T >
Shared_cap<T> L4Re::make_shared_cap ( L4Re::Cap_alloc ca)

Allocate a capability slot and wrap it in a Shared_cap.

Template Parameters
TType of the object the capability refers to.
Parameters
caCapability allocator to use.
Note
This function is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::make_shared_cap<T>().

Definition at line 60 of file shared_cap.

◆ make_shared_del_cap()

template<typename T >
Shared_del_cap<T> L4Re::make_shared_del_cap ( L4Re::Cap_alloc ca)

Allocate a capability slot and wrap it in a Shared_del_cap.

Template Parameters
TType of the object the capability refers to.
Parameters
caCapability allocator to use.
Note
This function is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::make_shared_del_cap<T>().

Definition at line 96 of file shared_cap.

◆ make_unique_cap()

template<typename T >
Unique_cap<T> L4Re::make_unique_cap ( L4Re::Cap_alloc ca)

Allocate a capability slot and wrap it in an Unique_cap.

Template Parameters
TType of the object the capability refers to.
Parameters
caCapability allocator to use.
Note
This function is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::make_unique_cap<T>().

Definition at line 58 of file unique_cap.

◆ make_unique_del_cap()

template<typename T >
Unique_del_cap<T> L4Re::make_unique_del_cap ( L4Re::Cap_alloc ca)

Allocate a capability slot and wrap it in an Unique_del_cap.

Template Parameters
TType of the object the capability refers to.
Parameters
caCapability allocator to use.
Note
This function is intended for users who implement a custom capability allocator; otherwise use L4Re::Util::make_unique_del_cap<T>().

Definition at line 91 of file unique_cap.