L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
L4::Ipc::Snd_fpage Class Reference

Send item or return item. More...

#include <ipc_types>

+ Inheritance diagram for L4::Ipc::Snd_fpage:
+ Collaboration diagram for L4::Ipc::Snd_fpage:

Public Types

enum  Map_type { Map = L4_MAP_ITEM_MAP , Grant = L4_MAP_ITEM_GRANT }
 *(Defined for send items only.)* Kind of mapping. More...
 
enum  Cacheopt { None = 0 , Cached = L4_FPAGE_CACHEABLE << 4 , Buffered = L4_FPAGE_BUFFERABLE << 4 , Uncached = L4_FPAGE_UNCACHEABLE << 4 }
 *(Defined for memory send items only.)* Caching options, see l4_fpage_cacheability_opt_t. More...
 
enum  Continue { Single = 0 , Last = 0 , More = L4_ITEM_CONT , Compound = L4_ITEM_CONT }
 Specify if the following item is associated with the same receive item as this one, see L4_ITEM_CONT. More...
 
- Public Types inherited from L4::Ipc::Gen_fpage
enum  Type { Special = L4_FPAGE_SPECIAL << 4 , Memory = L4_FPAGE_MEMORY << 4 , Io = L4_FPAGE_IO << 4 , Obj = L4_FPAGE_OBJ << 4 }
 Type of mapping object, see L4_fpage_type. More...
 

Public Member Functions

 Snd_fpage (l4_umword_t base=0, l4_umword_t data=0) noexcept
 Construct from raw values.
 
 Snd_fpage (l4_fpage_t const &fp, l4_addr_t snd_base=0, Map_type map_type=Map, Cacheopt cache=None, Continue cont=Last) noexcept
 Construct a send item for the memory space.
 
 Snd_fpage (L4::Cap< void > cap, unsigned rights, Map_type map_type=Map) noexcept
 Construct a send item for the object space.
 
unsigned order () const noexcept
 *(Defined only if send item or if local_id_received() is true.)* Get log₂ size.
 
unsigned snd_order () const noexcept
 *(Defined only if send item or if local_id_received() is true.)* Get log₂ size.
 
unsigned rcv_order () const noexcept
 *(Defined for return items only.)* Get log₂ size.
 
l4_addr_t base () const noexcept
 *(Defined only if send item or if local_id_received() is true.)* Get the start of the item (i.e., the start of its flexpage).
 
l4_addr_t snd_base () const noexcept
 Get the position in receive window for the case that this item has a different size than the corresponding receive item.
 
void snd_base (l4_addr_t b) noexcept
 Set the position in receive window for the case that this item has a different size than the corresponding receive item.
 
bool is_valid () const noexcept
 Check if the capability is valid.
 
bool cap_received () const noexcept
 *(Defined for return items only.)* Check if at least one object capability has been mapped for this item.
 
bool id_received () const noexcept
 *(Defined for return items only.)* Check if an IPC gate label has been received instead of a mapping.
 
bool local_id_received () const noexcept
 *(Defined for return items only.)* Check if a raw object flexpage has been received instead of a mapping.
 
bool is_compound () const noexcept
 Check if the item has the compound bit set, see Continue.
 
- Public Member Functions inherited from L4::Ipc::Gen_fpage
 Gen_fpage (l4_umword_t base, l4_umword_t data) noexcept
 Construct from raw values.
 
l4_umword_t data () const noexcept
 Return the raw flexpage descriptor.
 
l4_umword_t base_x () const noexcept
 Return the raw base descriptor.
 

Static Public Member Functions

static Snd_fpage obj (l4_cap_idx_t base, int order, unsigned char rights, l4_addr_t snd_base=0, Map_type map_type=Map, Continue cont=Last) noexcept
 Construct a send item for the object space.
 
static Snd_fpage mem (l4_addr_t base, int order, unsigned char rights, l4_addr_t snd_base=0, Map_type map_type=Map, Cacheopt cache=None, Continue cont=Last) noexcept
 Construct a send item for the memory space.
 
static Snd_fpage io (unsigned long base, int order, unsigned char rights, l4_addr_t snd_base=0, Map_type map_type=Map, Continue cont=Last) noexcept
 Construct a send item for the I/O port space.
 

Detailed Description

Send item or return item.

This class represents a typed message item in the message registers of the UTCB. If it is provided by the sender, then it is a send item. If it is provided by the kernel during IPC, it is a return item.

Note that some members are dedicated for send items only or return items only.

Definition at line 323 of file ipc_types.

Member Enumeration Documentation

◆ Cacheopt

*(Defined for memory send items only.)* Caching options, see l4_fpage_cacheability_opt_t.

Enumerator
None 

Copy options from sender.

Cached 

Cacheability option to enable caches for the mapping.

Buffered 

Cacheability option to enable buffered writes for the mapping.

Uncached 

Cacheability option to disable caching for the mapping.

Definition at line 336 of file ipc_types.

◆ Continue

Specify if the following item is associated with the same receive item as this one, see L4_ITEM_CONT.

Enumerator
Single 

Inverse of Compound.

Last 

Inverse of More.

More 

Alias for Compound.

Compound 

Denote that the following item shall be put into the same receive item as this one.

Definition at line 346 of file ipc_types.

◆ Map_type

*(Defined for send items only.)* Kind of mapping.

Enumerator
Map 

Flag as usual map operation.

Grant 

Flag as grant instead of map operation.

This means, the sender delegates access to the receiver and the kernel removes the rights from the sender (basically a move operation). The mapping in the receiver gets the new parent of any child mappings of the mapping of the sender. Rights revocation via send item/flexpage is not guaranteed to be applied to descendant mappings in case of grant. See Spaces and Mappings for more details on map/grant.

Note
The grant operation is not performed if the resulting rights of the receiver mapping would not contain the L4_CAP_FPAGE_R bit (for object capabilities) or none of the L4_FPAGE_RWX bits (memory and IO ports). In that case, the mapping is not created in the receiver space and not removed from the sender space.
If the removal of the whole mapping from the sender is not possible because the size of the mapped frame at the sender exceeds the size defined by the send or receive flexpage, the grant operation is turned into a regular map operation and the mapping is not removed from the sender. This would happen if, for example, a smaller part of an L4 superpage mapping shall be granted.

Definition at line 328 of file ipc_types.

Constructor & Destructor Documentation

◆ Snd_fpage() [1/2]

L4::Ipc::Snd_fpage::Snd_fpage ( l4_fpage_t const &  fp,
l4_addr_t  snd_base = 0,
Map_type  map_type = Map,
Cacheopt  cache = None,
Continue  cont = Last 
)
inlinenoexcept

Construct a send item for the memory space.

Parameters
fpMemory flexpage defining which range and kind of capabilities shall be sent (see l4_fpage()).
snd_basePosition in receive window in case it has a different size than fp.
map_typeSee Map_type.
cacheSee Cacheopt.
contSee Continue.

Definition at line 370 of file ipc_types.

◆ Snd_fpage() [2/2]

L4::Ipc::Snd_fpage::Snd_fpage ( L4::Cap< void >  cap,
unsigned  rights,
Map_type  map_type = Map 
)
inlinenoexcept

Construct a send item for the object space.

Parameters
capCapability to be sent.
rightsPermissions to be transferred. See L4_cap_fpage_rights and L4_obj_fpage_ctl.
map_typeSee Map_type.

Definition at line 386 of file ipc_types.

Member Function Documentation

◆ cap_received()

bool L4::Ipc::Snd_fpage::cap_received ( ) const
inlinenoexcept

*(Defined for return items only.)* Check if at least one object capability has been mapped for this item.

The capabilities themselves can then be retrieved from the cap slots that have been provided in the receive operation.

Note
If this function returns true and the receive window covers more than one capability slot, then it is not possible to determine which slots actually got capabilities mapped from the sender.
If the received capabilities do not have type object (see L4_FPAGE_OBJ), then this function returns false.

Definition at line 496 of file ipc_types.

◆ id_received()

bool L4::Ipc::Snd_fpage::id_received ( ) const
inlinenoexcept

*(Defined for return items only.)* Check if an IPC gate label has been received instead of a mapping.

If the L4_RCV_ITEM_LOCAL_ID flag has been set by the receiver, the conditions for local_id_received() do not apply, the sender sent an IPC gate capability, and the receiving thread is in the same task as the thread that is attached to the IPC gate, then no mapping is done for this item and only the bitwise OR (|) of the label of the IPC gate and the special and write permission (L4_CAP_FPAGE_S and L4_CAP_FPAGE_W) that would have been mapped is received.

The bitwise OR of the label and the permissions can be retrieved with Gen_fpage::data().

Definition at line 512 of file ipc_types.

◆ io()

static Snd_fpage L4::Ipc::Snd_fpage::io ( unsigned long  base,
int  order,
unsigned char  rights,
l4_addr_t  snd_base = 0,
Map_type  map_type = Map,
Continue  cont = Last 
)
inlinestaticnoexcept

Construct a send item for the I/O port space.

Parameters
baseStart of flexpage (see l4_iofpage()).
orderLog₂ size of flexpage (see l4_iofpage()).
rightsPermissions of flexpage (see L4_fpage_rights).
snd_basePosition in receive window in case it has a different size than 1 << order.
map_typeSee Map_type.
contSee Continue.

Definition at line 445 of file ipc_types.

References base(), l4_fpage_set_rights(), l4_iofpage(), None, order(), and snd_base().

+ Here is the call graph for this function:

◆ is_compound()

bool L4::Ipc::Snd_fpage::is_compound ( ) const
inlinenoexcept

Check if the item has the compound bit set, see Continue.

A set compound bit means the next message item of the same type will be mapped to the same receive buffer as this message item.

Definition at line 535 of file ipc_types.

◆ local_id_received()

bool L4::Ipc::Snd_fpage::local_id_received ( ) const
inlinenoexcept

*(Defined for return items only.)* Check if a raw object flexpage has been received instead of a mapping.

If the L4_RCV_ITEM_LOCAL_ID flag has been set by the receiver, and sender and receiver are in the same task, then no mapping is done for this item and only the raw flexpage (l4_fpage_t) is received.

This function checks if this is the case and if it is an object flexpage.

The flexpage can be retrieved with Gen_fpage::data().

Note
If a raw flexpage was received, but it does not have type object (see L4_FPAGE_OBJ), then this function returns false.

Definition at line 528 of file ipc_types.

◆ mem()

static Snd_fpage L4::Ipc::Snd_fpage::mem ( l4_addr_t  base,
int  order,
unsigned char  rights,
l4_addr_t  snd_base = 0,
Map_type  map_type = Map,
Cacheopt  cache = None,
Continue  cont = Last 
)
inlinestaticnoexcept

Construct a send item for the memory space.

Parameters
baseStart of flexpage (see l4_fpage()).
orderLog₂ size of flexpage (see l4_fpage()).
rightsPermissions of flexpage (see l4_fpage()).
snd_basePosition in receive window in case it has a different size than 1 << order.
map_typeSee Map_type.
cacheSee Cacheopt.
contSee Continue.
Examples
examples/libs/l4re/streammap/server.cc.

Definition at line 424 of file ipc_types.

References base(), l4_fpage(), order(), and snd_base().

+ Here is the call graph for this function:

◆ obj()

static Snd_fpage L4::Ipc::Snd_fpage::obj ( l4_cap_idx_t  base,
int  order,
unsigned char  rights,
l4_addr_t  snd_base = 0,
Map_type  map_type = Map,
Continue  cont = Last 
)
inlinestaticnoexcept

Construct a send item for the object space.

Parameters
baseStart of flexpage (see l4_obj_fpage()).
orderLog₂ size of flexpage (see l4_obj_fpage()).
rightsPermissions of flexpage (see l4_obj_fpage()).
snd_basePosition in receive window in case it has a different size than 1 << order.
map_typeSee Map_type.
contSee Continue.

Definition at line 402 of file ipc_types.

References base(), l4_obj_fpage(), None, order(), and snd_base().

+ Here is the call graph for this function:

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