105 {
return r.dispatch(tag, obj, utcb); }
115template<
typename R >
126 {
return r->dispatch(tag, obj, utcb); }
139template<
typename R,
typename Exc>
183template<
typename R,
typename Exc,
typename Pr
inter >
201 _printer.printf(
"Error in handling IPC: %s: %s\n", e.str(),
207 _printer.printf(
"Error in handling IPC: %d (%s)\n", err,
208 l4sys_errtostr(err));
213 _printer.printf(
"Error in handling IPC: %ld (%s)\n", err,
214 l4sys_errtostr(err));
306template<
typename LOOP_HOOKS = Ipc_svr::Default_loop_hooks >
320 L4_DEPRECATED(
"Do not specify the UTCB with the constructor. "
321 "Supply it on the loop function if needed.")
337 template<
typename DISPATCH >
343 template<
typename R >
354 template<
typename EXC,
typename R >
367 template<
typename EXC,
typename R,
typename Pr
inter >
379 template<
typename U>
static auto _has_setup_reply_cap(
int)
386 static constexpr bool Has_setup_reply_cap
387 = L4::Types::Same_v<decltype(_has_setup_reply_cap<Server>(0)),
391template<
typename L >
396 if constexpr (Has_setup_reply_cap)
397 reply_cap = this->setup_reply_cap().cap();
421template<
typename L >
422template<
typename DISPATCH >
435 this->error(res, utcb);
440 r = dispatch(res, p, utcb);
@ Invalid
Invalid capability selector.
C++ interface for capabilities.
Empty implementation of Server_iface.
L4::Cap< void > get_rcv_cap(int) const override
Returns L4::Cap<void>::Invalid, we have no buffer management.
int remove_timeout(Timeout *) override
Returns -L4_ENOSYS, we have no timeout queue.
int alloc_buffer_demand(Demand const &demand) override
Tells the server to allocate buffers for the given demand.
unsigned first_free_br() const
Returns 1 as first free buffer.
int realloc_rcv_cap(int) override
Returns -L4_ENOMEM, we have no buffer management.
int add_timeout(Timeout *, l4_kernel_clock_t) override
Returns -L4_ENOSYS, we have no timeout queue.
void setup_wait(l4_utcb_t *utcb, L4::Ipc_svr::Reply_mode)
Setup wait function for the server loop (Server<>).
L4::Type_info::Demand Demand
Data type expressing server-side demand for receive buffers.
Callback interface for Timeout_queue.
L4_NORETURN void loop_dbg(R r, Printer p, l4_utcb_t *u=l4_utcb())
Server loop with internal exception handling including message printing.
l4_msgtag_t reply_n_wait(l4_msgtag_t reply, l4_umword_t *p, l4_utcb_t *)
Internal implementation for reply and wait.
Server()
Initializes the server loop.
L4_NORETURN void internal_loop(DISPATCH dispatch, l4_utcb_t *)
The server loop.
L4_NORETURN void loop(R r, l4_utcb_t *u=l4_utcb())
Server loop with internal exception handling.
L4_NORETURN void loop_noexc(R r, l4_utcb_t *u=l4_utcb())
Server loop without exception handling.
Server(l4_utcb_t *)
Initializes the server loop.
bool no_demand() const noexcept
Reply_mode
Reply mode for server loop.
@ Reply_separate
Server shall call reply and wait separately.
@ Reply_compound
Server shall use a compound reply and wait (fast).
unsigned long l4_umword_t
Unsigned machine word.
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
unsigned long l4_cap_idx_t
Capability selector type.
l4_msgtag_t l4_ipc(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_umword_t flags, l4_umword_t slabel, l4_msgtag_t tag, l4_umword_t *rlabel, l4_timeout_t timeout) L4_NOTHROW
Generic L4 object invocation.
l4_msgtag_t l4_ipc_reply(l4_cap_idx_t reply_cap, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Reply operation (uses a reply capability).
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
#define L4_IPC_SEND_TIMEOUT_0
0 send timeout
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
#define L4_NORETURN
Noreturn function attribute.
#define L4_DEPRECATED(s)
Mark symbol deprecated.
#define L4_INVALID_REPLY_CAP
Invalid reply capability selector.
#define L4_SYSF_WAIT
Wait flags (combines receive and open wait).
#define L4_SYSF_REPLY_AND_WAIT
Reply-and-wait flags.
Helper classes for L4::Server instantiation.
L4 low-level kernel interface.
Mix in for LOOP_HOOKS to always use compound reply and wait.
Dispatch helper that, in addition to what Exc_dispatch does, prints exception messages.
l4_msgtag_t operator()(l4_msgtag_t tag, l4_umword_t obj, l4_utcb_t *utcb)
Dispatch the call via Direct_dispatch<R>(), handle exceptions, and print the exception message.
Dbg_dispatch(R r, Printer p)
Make an exception handling dispatcher.
Mix in for LOOP_HOOKS for setup_wait no op.
Mix in for LOOP_HOOKS to use a 0 send and an infinite receive timeout.
R * r
stores a pointer to the registry object
Direct_dispatch(R *r)
Make a direct dispatcher.
Direct dispatch helper, for forwarding dispatch calls to a registry R.
R & r
stores a reference to the registry object
l4_msgtag_t operator()(l4_msgtag_t tag, l4_umword_t obj, l4_utcb_t *utcb)
call operator forwarding to r.dispatch()
Direct_dispatch(R &r)
Make a direct dispatcher.
Dispatch helper wrapping try {} catch {} around the dispatch call.
Exc_dispatch(R r)
Make an exception handling dispatcher.
l4_msgtag_t operator()(l4_msgtag_t tag, l4_umword_t obj, l4_utcb_t *utcb)
Dispatch the call via Direct_dispatch<R>() and handle exceptions.
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.
Message tag data structure.
long label() const L4_NOTHROW
Get the protocol value.
bool has_error() const L4_NOTHROW
Test if flags indicate an error.