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

An explicit reply capability. More...

#include <capability.h>

Collaboration diagram for L4::Reply_cap:

Public Member Functions

constexpr Reply_cap () noexcept=default
 Construct an invalid reply capability.
constexpr Reply_cap (Reply_cap_idx cap, Reply_cap_alloc *alloc) noexcept
 Construct a valid explicit reply capability.
 ~Reply_cap ()
 Destroy reply capability.
l4_ret_t reply (l4_msgtag_t tag, l4_utcb_t *utcb=l4_utcb()) noexcept
 Reply with this reply capability.
constexpr Reply_cap_idx get () const noexcept
 Get reply capability index.
void reset (Reply_cap_idx cap=Reply_cap_idx(), Reply_cap_alloc *alloc=nullptr) noexcept
 Replace reply capability.

Detailed Description

An explicit reply capability.

Represents a use-once, explicit reply capability. If valid, the class will ensure that the caller will always get a reply. Once used, the reply capability slot will be immediately released to the associated reply capability allocator.

Definition at line 529 of file capability.h.

Constructor & Destructor Documentation

◆ Reply_cap()

L4::Reply_cap::Reply_cap ( Reply_cap_idx cap,
Reply_cap_alloc * alloc )
inlineconstexprnoexcept

Construct a valid explicit reply capability.

The object will take ownership of the reply capability slot. It is returned to the allocator after being used.

Parameters
capThe reply capability index
allocThe associated reply capability allocator.

Definition at line 544 of file capability.h.

References Reply_cap().

Here is the call graph for this function:

◆ ~Reply_cap()

L4::Reply_cap::~Reply_cap ( )
inline

Destroy reply capability.

Attention
If the reply capability is still valid, an L4_EDROPREPLY error reply is sent. See Reply_cap::reset().

Definition at line 554 of file capability.h.

References reset().

Here is the call graph for this function:

Member Function Documentation

◆ get()

Reply_cap_idx L4::Reply_cap::get ( ) const
inlineconstexprnoexcept

Get reply capability index.

This method must not be used to send a reply. Use Reply_cap::reply() instead that does the proper reply capability lifetime management.

Definition at line 612 of file capability.h.

◆ reply()

l4_ret_t L4::Reply_cap::reply ( l4_msgtag_t tag,
l4_utcb_t * utcb = l4_utcb() )
inlinenoexcept

Reply with this reply capability.

Disposes the reply capability after the reply was sent. Can be used only once. If the reply object is not valid, no message is sent.

Parameters
tagMessage tag for reply. The UTCB must have been prepared.
utcbUTCB to be used for this operation, shall be the UTCB of the calling thread. See l4_utcb.
Return values
0Success
-(L4_EIPC_LO+ L4_IPC_ENOT_EXISTENT) Reply capability not valid
<0Other IPC error

Definition at line 589 of file capability.h.

References L4_IPC_BOTH_TIMEOUT_0, L4_IPC_ENOT_EXISTENT, l4_ipc_error(), l4_ipc_reply(), and l4_ipc_to_errno().

Here is the call graph for this function:

◆ reset()

void L4::Reply_cap::reset ( Reply_cap_idx cap = Reply_cap_idx(),
Reply_cap_alloc * alloc = nullptr )
inlinenoexcept

Replace reply capability.

Attention
If the current reply capability is valid, an L4_EDROPREPLY error reply is sent to the caller!

Definition at line 639 of file capability.h.

References L4::Reply_cap_alloc::alloc(), L4_EDROPREPLY, L4_IPC_BOTH_TIMEOUT_0, l4_ipc_reply(), l4_msgtag(), and l4_utcb().

Referenced by ~Reply_cap().

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

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