20 #include "ipc_epiface" 96 template<
typename HOOKS >
104 : _timeout(HOOKS::next_timeout(HOOKS::current_time())) {}
114 if (_timeout <= this->current_time()
118 _timeout = this->next_timeout(_timeout);
120 HOOKS::setup_wait(utcb, mode);
125 if (_timeout <= this->current_time())
138 template<
typename R >
149 {
return r.dispatch(tag, obj, utcb); }
159 template<
typename R >
170 {
return r->dispatch(tag, obj, utcb); }
183 template<
typename R,
typename Exc>
289 template<
typename LOOP_HOOKS = Ipc_svr::Default_loop_hooks >
306 template<
typename DISPATCH >
307 inline L4_NORETURN void internal_loop(DISPATCH dispatch);
312 template<
typename R >
322 template<
typename EXC,
typename R >
334 template<
typename L >
343 this->setup_wait(_utcb, m);
357 template<
typename L >
358 template<
typename DISPATCH >
368 res = reply_n_wait(r, &p);
371 this->error(res, _utcb);
376 r = dispatch(res, p, _utcb);
l4_msgtag_t reply_n_wait(l4_msgtag_t reply, l4_umword_t *p)
Internal implementation for reply and wait.
Mix in for LOOP_HOOKS to always use compound reply and wait.
l4_timeout_t l4_timeout(l4_timeout_s snd, l4_timeout_s rcv) L4_NOTHROW
Combine send and receive timeout in a timeout.
L4_NORETURN void loop(R r)
Server loop with internal exception handling.
Data type for expressing the needed receive buffers at the server-side of an interface.
R * r
stores a pointer to the registry object
Reply_mode
Reply mode for server loop.
Invalid capability selector.
int add_timeout(Timeout *, l4_kernel_clock_t)
Returns -L4_ENOSYS, we have no timeout queue.
Interface for server-loop related functions.
Server shall call reply and wait separately.
L4::Cap< void > get_rcv_cap(int) const
Returns L4::Cap<void>::Invalid, we have no buffer management.
L4 low-level kernel interface.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Encapsulation of the buffer-registers block in the UTCB.
Callback interface for Timeout_queue.
long label() const
Get the protocol value.
L4_NORETURN void loop_noexc(R r)
Server loop without exception handling.
Basic server loop for handling client requests.
l4_timeout_s l4_timeout_abs(l4_kernel_clock_t pint, int br) L4_NOTHROW
Set an absolute timeout.
Mix in for LOOP_HOOKS to use a 0 send and a infinite receive timeout.
l4_umword_t bdr
Buffer descriptor.
#define L4_NORETURN
Noreturn function attribute.
int alloc_buffer_demand(Demand const &demand)
Tells the server to allocate buffers for the given demand.
unsigned has_error() const
Test if flags indicate an error.
l4_uint64_t l4_cpu_time_t
CPU clock type.
unsigned long l4_umword_t
Unsigned machine word.
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Empty implementation of Server_iface.
Exc_dispatch(R r)
Make en exception handling dispatcher.
void setup_wait(l4_utcb_t *utcb, L4::Ipc_svr::Reply_mode)
Setup wait function for the server loop (Server<>).
l4_msgtag_t l4_ipc_reply_and_wait(l4_utcb_t *utcb, l4_msgtag_t tag, l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW
Reply and wait operation (uses the reply capability).
l4_msgtag_t operator()(l4_msgtag_t tag, l4_umword_t obj, l4_utcb_t *utcb)
call operator forwarding to r.dispatch()
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
l4_msgtag_t l4_ipc_send(l4_cap_idx_t dest, l4_utcb_t *utcb, l4_msgtag_t tag, l4_timeout_t timeout) L4_NOTHROW
Send a message to an object (do not wait for a reply).
Direct disptach helper, for forwarding dispatch calls a registry R.
#define L4_IPC_SEND_TIMEOUT_0
0 send timeout
Direct_dispatch(R &r)
Make a direct dispatcher.
int remove_timeout(Timeout *)
Returns -L4_ENOSYS, we have no timeout queue.
l4_msgtag_t l4_ipc_wait(l4_utcb_t *utcb, l4_umword_t *label, l4_timeout_t timeout) L4_NOTHROW
Wait for an incoming message from any possible sender.
Direct_dispatch(R *r)
Make a direct dispatcher.
#define L4_IPC_TIMEOUT_0
Timeout constants.
C++ interface for capabilities.
int realloc_rcv_cap(int)
Returns -L4_ENOMEM, we have no buffer management.
R & r
stores a reference to the registry object
Message tag data structure.
unsigned first_free_br() const
Returns 1 as first free buffer.
l4_umword_t br[L4_UTCB_GENERIC_BUFFERS_SIZE]
Buffer registers.
Mix in for LOOP_HOOKS to ignore IPC errors.
Server(l4_utcb_t *utcb)
Initializes the server loop.
Dispatch helper wrapping try {} catch {} around the dispatch call.
Mix in for LOOP_HOOKS for setup_wait no op.
Server shall use a compound reply and wait (fast).
L4_NORETURN void internal_loop(DISPATCH dispatch)
The server loop.