12#include <l4/sys/cxx/ipc_server_loop>
13#include <l4/cxx/ipc_timeout_queue>
14#include <l4/cxx/minmax>
28 private L4::Ipc_svr::Server_iface::Mem_window::Allocator
60 for (
unsigned i = 0; i < _caps; ++i)
82 if ( cxx::max(d.
caps, _caps) + 1
83 + (cxx::max(d.
mem, _mem_order) ? 2 : 0) + 1
85 > L4_UTCB_GENERIC_BUFFERS_SIZE)
90 while (_caps < d.
caps)
96 reinterpret_cast<Small_buf&
>(_brs[_caps])
97 = Small_buf(cap.
cap(), _cap_flags);
103 if (d.
mem > _mem_order)
107 ->reserve_area(&start, 1UL << d.
mem,
124 _brs[_caps + 1] = rcv_fpage.
base_x();
125 _brs[_caps + 2] = rcv_fpage.
data();
127 _used_brs = _caps + 4;
132 _used_brs = _caps + 2;
141 if (i < 0 || i >= _caps)
151 if (i < 0 || i >= _caps)
158 reinterpret_cast<Small_buf&
>(_brs[i])
159 = Small_buf(cap.
cap(), _cap_flags);
172 ->reserve_area(&start, 1UL << _mem_order,
187 _brs[_caps + 1] = rcv_fpage.
base_x();
188 _brs[_caps + 2] = rcv_fpage.
data();
220 for (
unsigned i = 0; i < _used_brs; ++i)
229 return L4_UTCB_GENERIC_BUFFERS_SIZE - Brs_per_timeout;
235 unsigned char _caps = 0;
236 unsigned char _mem_order = 0;
237 unsigned char _used_brs = 2;
static Env const * env() noexcept
Returns the initial environment for the current task.
L4::Cap< Rm > rm() const noexcept
Object-capability to the region map.
L4::Cap< L4::Task > task() const noexcept
Object-capability of the user task.
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.
cxx::Result< L4::Ipc_svr::Server_iface::Mem_window > get_rcv_mem() noexcept override
Take the current memory receive window.
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.
@ Invalid
Invalid capability selector.
C++ interface for capabilities.
l4_umword_t base_x() const noexcept
Return the raw base descriptor.
l4_umword_t data() const noexcept
Return the raw flexpage descriptor.
A receive item for receiving a single object capability.
Interface for server-loop related functions.
L4::Type_info::Demand Demand
Data type expressing server-side demand for receive buffers.
Loop hooks mixin for integrating a timeout queue into the server loop.
Callback interface for Timeout_queue.
unsigned char mem
size (2^mem bytes) of memory receive buffer.
unsigned char caps
number of capability receive buffers.
unsigned char ports
number of IO-port receive buffers.
A result of a function call.
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.
unsigned long l4_addr_t
Address type.
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
#define L4_CAP_MASK
Mask to get only the relevant bits of an l4_cap_idx_t.
@ L4_EINVAL
Invalid argument.
L4_CONSTEXPR int l4_is_fpage_valid(l4_fpage_t fp) L4_NOTHROW
Test if the flexpage is valid.
L4_CONSTEXPR l4_addr_t l4_fpage_memaddr(l4_fpage_t f) L4_NOTHROW
Return the memory address from the memory flexpage.
L4_CONSTEXPR l4_fpage_t l4_fpage(l4_addr_t address, unsigned int order, unsigned char rights) L4_NOTHROW
Create a memory flexpage.
L4_CONSTEXPR l4_fpage_t l4_fpage_invalid(void) L4_NOTHROW
Get an invalid flexpage.
@ L4_FPAGE_RWX
Read-write-execute flexpage.
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.
l4_umword_t l4_bdr(l4_umword_t mem, l4_umword_t io, l4_umword_t obj, l4_umword_t flags) L4_NOTHROW
Create a buffer descriptor.
_Cap_alloc cap_alloc
Capability allocator.
Documentation of the L4 Runtime Environment utility functionality in C++.
@ L4_FP_ALL_SPACES
Flag to tell the unmap operation to revoke permissions from all child mappings including the mapping ...
@ Reserved
Region is reserved (blocked).
@ Search_addr
Search for a suitable address range.
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 an 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.