L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4::Ipc::Cap< T > Class Template Reference

Capability type for RPC interfaces (see L4::Cap<T>). More...

#include <ipc_types>

Inheritance diagram for L4::Ipc::Cap< T >:
Collaboration diagram for L4::Ipc::Cap< T >:

Public Types

enum  { Rights_mask = 0xff , Map_type_mask = 0x100 , Cap_mask = L4_CAP_MASK }
enum  Map_type { Map = 0 , Grant = 0x100 }
 Kind of mapping. More...

Public Member Functions

template<typename O>
 Cap (Cap< O > const &o) noexcept
 Make copy with conversion.
 Cap (L4::Cap< T > cap) noexcept
 Make a Cap from L4::Cap<T>, with minimal rights.
template<typename O>
 Cap (L4::Cap< O > cap) noexcept
 Make IPC Cap from L4::Cap with conversion (and minimal rights).
 Cap () noexcept
 Make an invalid cap.
 Cap (L4::Cap< T > cap, unsigned char rights) noexcept
 Make a Cap from L4::Cap<T> with the given rights.
 Cap (L4::Cap< T > cap, unsigned char rights, Map_type map_type) noexcept
 Make a Cap from L4::Cap<T> with the given rights and map type.
L4::Cap< T > cap () const noexcept
 Return the L4::Cap<T> of this Cap.
unsigned rights () const noexcept
 Return the rights bits stored in this IPC cap.
L4::Ipc::Snd_fpage fpage () const noexcept
 Return the send flexpage for this Cap (see l4_fpage_t).
bool is_valid () const noexcept
 Return true if this Cap is valid.

Static Public Member Functions

static Cap from_ci (l4_cap_idx_t c) noexcept
 Create an IPC capability from a C capability index plus rights.

Detailed Description

template<typename T>
class L4::Ipc::Cap< T >

Capability type for RPC interfaces (see L4::Cap<T>).

Template Parameters
Ttype of the interface referenced by the capability.

In contrast to L4::Cap<T> this type additionally stores a rights mask that shall be used when the capability is transferred to the receiver. This allows to apply restrictions to the transferred capability in the form of a subset of the rights possessed by the sender.

See also
L4::Ipc::make_cap()

Definition at line 698 of file ipc_types.

Member Enumeration Documentation

◆ anonymous enum

template<typename T>
anonymous enum
Enumerator
Rights_mask 

Mask for rights bits stored internally.

L4_FPAGE_RIGHTS_MASK | L4_FPAGE_C_NO_REF_CNT | L4_FPAGE_C_OBJ_RIGHTS).

Map_type_mask 

Mask for map vs.

grant operation.

Cap_mask 

Mask for significant capability bits.

(incl. the invalid bit to support invalid caps)

Definition at line 704 of file ipc_types.

◆ Map_type

template<typename T>
enum L4::Ipc::Cap::Map_type

Kind of mapping.

Enumerator
Map 

Map capability in RPC operation.

Grant 

Grant capability in RPC operation.

See also
L4_MAP_ITEM_GRANT

Definition at line 726 of file ipc_types.

Constructor & Destructor Documentation

◆ Cap() [1/2]

template<typename T>
L4::Ipc::Cap< T >::Cap ( L4::Cap< T > cap,
unsigned char rights )
inlinenoexcept

Make a Cap from L4::Cap<T> with the given rights.

Parameters
capCapability to be sent.
rightsRights to be sent. Consists of L4_fpage_rights and Attributes and additional permissions for object send items.

Definition at line 764 of file ipc_types.

◆ Cap() [2/2]

template<typename T>
L4::Ipc::Cap< T >::Cap ( L4::Cap< T > cap,
unsigned char rights,
Map_type map_type )
inlinenoexcept

Make a Cap from L4::Cap<T> with the given rights and map type.

Parameters
capCapability to be sent.
rightsRights to be sent. Consists of L4_fpage_rights and Attributes and additional permissions for object send items.
map_typeIndicate if capability is mapped or granted.

Definition at line 775 of file ipc_types.

Member Function Documentation

◆ from_ci()

template<typename T>
Cap L4::Ipc::Cap< T >::from_ci ( l4_cap_idx_t c)
inlinestaticnoexcept

Create an IPC capability from a C capability index plus rights.

Parameters
cC capability index with the lowest 8 bits used as rights for the map operation (see L4_fpage_rights).

Definition at line 785 of file ipc_types.


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