22#include <l4/sys/cxx/ipc_server_loop>
23#include <l4/cxx/ipc_timeout_queue>
26namespace L4Re {
namespace Util {
39 enum { _mem = 0, _ports = 0 };
56 for (
unsigned i = 0; i < _caps; ++i)
74 if (d.
caps + d.
mem * 2 + d.
ports * 2 + Brs_per_timeout + 1
75 > L4_UTCB_GENERIC_BUFFERS_SIZE)
80 while (_caps < d.
caps)
86 reinterpret_cast<Small_buf&
>(_brs[_caps])
87 = Small_buf(cap.
cap(), _cap_flags);
99 if (i < 0 || i >= _caps)
109 if (i < 0 || i >= _caps)
116 reinterpret_cast<Small_buf&
>(_brs[i])
117 = Small_buf(cap.
cap(), _cap_flags);
149 for (
unsigned i = 0; i <= _caps; ++i)
158 return L4_UTCB_GENERIC_BUFFERS_SIZE - Brs_per_timeout;
164 unsigned short _caps;
165 unsigned long _cap_flags;
Buffer-register (BR) manager for L4::Server.
int realloc_rcv_cap(int i) override
Allocate a new capability for the given receive buffer.
unsigned first_free_br() const
Used for assigning BRs for a timeout.
int add_timeout(L4::Ipc_svr::Timeout *, l4_kernel_clock_t) override
No timeouts handled by us.
void set_rcv_cap_flags(unsigned long flags)
Set the receive flags for the buffers.
void setup_wait(l4_utcb_t *utcb, L4::Ipc_svr::Reply_mode)
setup_wait() used the server loop (L4::Server)
Br_manager()
Make a buffer-register (BR) manager.
L4::Cap< void > get_rcv_cap(int i) const override
Get capability slot allocated to the given receive buffer.
int remove_timeout(L4::Ipc_svr::Timeout *) override
No timeouts handled by us.
int alloc_buffer_demand(Demand const &d) override
Tells the server to allocate buffers for the given demand.
l4_cap_idx_t cap() const noexcept
Return capability selector.
C++ interface for capabilities.
A receive item for receiving a single object capability.
Interface for server-loop related functions.
Loop hooks mixin for integrating a timeout queue into the server loop.
Callback interface for Timeout_queue.
Data type for expressing the needed receive buffers at the server-side of an interface.
unsigned char mem
number of memory receive buffers.
unsigned char caps
number of capability receive buffers.
unsigned char ports
number of IO-port receive buffers.
l4_kernel_info_t const * l4re_kip(void) L4_NOTHROW
Get Kernel Info Page.
Reply_mode
Reply mode for server loop.
unsigned long l4_umword_t
Unsigned machine word.
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
@ L4_CAP_MASK
Mask to get only the relevant bits of an l4_cap_idx_t.
@ L4_EINVAL
Invalid argument.
l4_cpu_time_t l4_kip_clock(l4_kernel_info_t const *kip) L4_NOTHROW
Return clock value from the KIP.
@ L4_RCV_ITEM_LOCAL_ID
The receiver requests to receive a local ID instead of a mapping whenever possible.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
_Cap_alloc & cap_alloc
Capability allocator.
Predefined server-loop hooks for a server loop using the Br_manager.
Predefined server-loop hooks for a server with using the Br_manager and a timeout queue.
Mix in for LOOP_HOOKS to always use compound reply and wait.
Mix in for LOOP_HOOKS to use a 0 send and a infinite receive timeout.
Mix in for LOOP_HOOKS to ignore IPC errors.
Encapsulation of the buffer-registers block in the UTCB.
l4_umword_t br[L4_UTCB_GENERIC_BUFFERS_SIZE]
Buffer registers.
l4_umword_t bdr
Buffer descriptor.
Low-level assert implementation.
#define l4_assert(expr)
Low-level assert.