22 #include <l4/sys/cxx/ipc_server_loop>
23 #include <l4/cxx/ipc_timeout_queue>
26 namespace L4Re {
namespace Util {
39 enum { _mem = 0, _ports = 0 };
55 for (
unsigned i = 0; i < _caps; ++i)
78 while (_caps < d.
caps)
84 reinterpret_cast<Small_buf&
>(_brs[_caps])
85 = Small_buf(cap.
cap(), _cap_flags);
97 if (i < 0 || i >= _caps)
107 if (i < 0 || i >= _caps)
114 reinterpret_cast<Small_buf&
>(_brs[i])
115 = Small_buf(cap.
cap(), _cap_flags);
147 for (
unsigned i = 0; i <= _caps; ++i)
162 unsigned short _caps;
163 unsigned long _cap_flags;
Buffer-register (BR) manager for L4::Server.
unsigned first_free_br() const
Used for assigning BRs for a timeout.
int realloc_rcv_cap(int i)
Allocate a new capability for the given receive buffer.
void set_rcv_cap_flags(unsigned long flags)
Set the receive flags for the buffers.
int remove_timeout(L4::Ipc_svr::Timeout *)
No timeouts handled by us.
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.
int alloc_buffer_demand(Demand const &d)
Tells the server to allocate buffers for the given demand.
L4::Cap< void > get_rcv_cap(int i) const
Get capability slot allocated to the given receive buffer.
int add_timeout(L4::Ipc_svr::Timeout *, l4_kernel_clock_t)
No timeouts handled by us.
L4::Cap< void > alloc() noexcept
Allocate a new capability slot.
bool free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES) noexcept
Free the capability.
l4_cap_idx_t cap() const noexcept
Return capability selector.
C++ interface for capabilities.
A receive item for receiving a single 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 * 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_RCV_ITEM_LOCAL_ID
The receiver requests to receive a local ID instead of a mapping whenever possible.
@ L4_UTCB_GENERIC_BUFFERS_SIZE
Total number of buffer registers (BRs) available.
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.
l4_cpu_time_t l4_kip_clock(l4_kernel_info_t *kip) L4_NOTHROW
Return clock value from the KIP.