L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
Message Items

Message item related functions. More...

+ Collaboration diagram for Message Items:

Enumerations

enum  l4_msg_item_consts_t {
  L4_ITEM_MAP = 8 , L4_ITEM_CONT = 1 , L4_MAP_ITEM_GRANT = 2 , L4_MAP_ITEM_MAP = 0 ,
  L4_RCV_ITEM_SINGLE_CAP = L4_ITEM_MAP | 2 , L4_RCV_ITEM_LOCAL_ID = 4
}
 Constants for message items. More...
 

Functions

l4_umword_t l4_map_control (l4_umword_t spot, unsigned char cache, unsigned grant) L4_NOTHROW
 Create the first word for a map item for the memory space.
 
l4_umword_t l4_map_obj_control (l4_umword_t spot, unsigned grant) L4_NOTHROW
 Create the first word for a map item for the object space.
 

Detailed Description

Message item related functions.

Message items are typed items that can be transferred via IPC operations. Message items are also used to specify receive windows for typed items to be received. Message items are placed in the message registers (MRs) of the UTCB of the sending thread. Receive items are placed in the buffer registers (BRs) of the UTCB of the receiving thread.

Message items are usually two-word data structures. The first word denotes the type of the message item (for example a memory flex-page, io flex-page or object flex-page) and the second word contains information depending on the type. There is actually one exception that is a small (one word) receive buffer item for a single capability.

Enumeration Type Documentation

◆ l4_msg_item_consts_t

Constants for message items.

Enumerator
L4_ITEM_MAP 

Identify a message item as map item.

L4_ITEM_CONT 

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

L4_MAP_ITEM_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.
L4_MAP_ITEM_MAP 

Flag as usual map operation.

L4_RCV_ITEM_SINGLE_CAP 

Mark the receive buffer to be a small receive item that describes a buffer for a single object capability.

L4_RCV_ITEM_LOCAL_ID 

The receiver requests to receive a local ID instead of a mapping whenever possible.

This flag may only be used for small buffers, see L4_RCV_ITEM_SINGLE_CAP.

When this flag is set, then,

  • when sender and receiver are bound to the same task, then no mapping is done for this item and just the capability index is transferred,
  • otherwise, when the sender specified an IPC gate for transfer that is bound to a thread that is bound to the same task as the receiving thread, then no mapping is done for this item and just the label bitwise disjoint with the L4_CAP_FPAGE_W and L4_CAP_FPAGE_S permissions that would have been mapped is transferred,
  • otherwise a regular mapping is done for this item.

Definition at line 224 of file consts.h.

Function Documentation

◆ l4_map_control()

l4_umword_t l4_map_control ( l4_umword_t  spot,
unsigned char  cache,
unsigned  grant 
)
inline

Create the first word for a map item for the memory space.

Parameters
spotHot spot address, used to determine what is actually mapped when send and receive flex page have differing sizes.
cacheCacheability hints for memory flex pages. See Cacheability options.
grantIndicates if it is a map or a grant item. Allowed values: L4_MAP_ITEM_MAP, L4_MAP_ITEM_GRANT.
Returns
The value to be used as first word in a map item for memory.

Definition at line 707 of file __l4_fpage.h.

References L4_FPAGE_CONTROL_MASK, and L4_ITEM_MAP.

Referenced by l4_map_obj_control().

+ Here is the caller graph for this function:

◆ l4_map_obj_control()

l4_umword_t l4_map_obj_control ( l4_umword_t  spot,
unsigned  grant 
)
inline

Create the first word for a map item for the object space.

Parameters
spotHot spot address, used to determine what is actually mapped when send and receive flex pages have different size.
grantIndicates if it is a map item or a grant item. Allowed values: L4_MAP_ITEM_MAP, L4_MAP_ITEM_GRANT.
Returns
The value to be used as first word in a map item for kernel objects or IO-ports.

Definition at line 714 of file __l4_fpage.h.

References l4_map_control().

Referenced by l4_icu_bind_u(), l4_icu_unbind_u(), l4_irq_mux_chain_u(), and L4::Cap_base::snd_base().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: