L4Re Operating System Framework
Interface and Usage Documentation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
L4::Server< LOOP_HOOKS > Class Template Reference

Basic server loop for handling client requests. More...

#include <ipc_server_loop>

+ Inheritance diagram for L4::Server< LOOP_HOOKS >:
+ Collaboration diagram for L4::Server< LOOP_HOOKS >:

Public Member Functions

 Server (l4_utcb_t *)
 Initializes the server loop.
 
 Server ()
 Initializes the server loop.
 
template<typename DISPATCH >
L4_NORETURN void internal_loop (DISPATCH dispatch, l4_utcb_t *)
 The server loop.
 
template<typename R >
L4_NORETURN void loop_noexc (R r, l4_utcb_t *u=l4_utcb())
 Server loop without exception handling.
 
template<typename EXC , typename R >
L4_NORETURN void loop (R r, l4_utcb_t *u=l4_utcb())
 Server loop with internal exception handling.
 
template<typename EXC , typename R , typename Printer >
L4_NORETURN void loop_dbg (R r, Printer p, l4_utcb_t *u=l4_utcb())
 Server loop with internal exception handling including message printing.
 
- Public Member Functions inherited from L4::Ipc_svr::Br_manager_no_buffers
int alloc_buffer_demand (Demand const &demand) override
 Tells the server to allocate buffers for the given demand.
 
L4::Cap< void > get_rcv_cap (int) const override
 Returns L4::Cap<void>::Invalid, we have no buffer management.
 
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.
 
int remove_timeout (Timeout *) override
 Returns -L4_ENOSYS, we have no timeout queue.
 
- Public Member Functions inherited from L4::Ipc_svr::Server_iface
 Server_iface ()
 Make a server interface.
 
template<typename T >
L4::Cap< T > rcv_cap (int index) const
 Get given receive buffer as typed capability.
 
L4::Cap< void > rcv_cap (int index) const
 Get receive cap with the given index as generic (void) type.
 

Protected Member Functions

l4_msgtag_t reply_n_wait (l4_msgtag_t reply, l4_umword_t *p, l4_utcb_t *)
 Internal implementation for reply and wait.
 
- Protected Member Functions inherited from L4::Ipc_svr::Br_manager_no_buffers
unsigned first_free_br () const
 Returns 1 as first free buffer.
 
void setup_wait (l4_utcb_t *utcb, L4::Ipc_svr::Reply_mode)
 Setup wait function for the server loop (Server<>).
 

Additional Inherited Members

- Public Types inherited from L4::Ipc_svr::Server_iface
typedef L4::Type_info::Demand Demand
 Data type expressing server-side demand for receive buffers.
 

Detailed Description

template<typename LOOP_HOOKS = Ipc_svr::Default_loop_hooks>
class L4::Server< LOOP_HOOKS >

Basic server loop for handling client requests.

Parameters
LOOP_HOOKSthe server inherits from LOOP_HOOKS and calls the hooks defined in LOOP_HOOKS in the server loop. See Ipc_svr::Default_loop_hooks, Ipc_svr::Ignore_errors, Ipc_svr::Default_timeout, Ipc_svr::Compound_reply, and Ipc_svr::Br_manager_no_buffers.

This is basically a simple server loop that uses a single message buffer for receiving requests and sending replies. The dispatcher determines how incoming messages are handled.

Definition at line 307 of file ipc_server_loop.

Constructor & Destructor Documentation

◆ Server()

template<typename LOOP_HOOKS = Ipc_svr::Default_loop_hooks>
L4::Server< LOOP_HOOKS >::Server ( l4_utcb_t )
inlineexplicit

Initializes the server loop.

Note that this variant is deprecated. The UTCB can be specified with the server loop function (l4_utcb() is the default). (2021-10)

Definition at line 319 of file ipc_server_loop.

Member Function Documentation

◆ internal_loop()

template<typename L >
template<typename DISPATCH >
L4_NORETURN void L4::Server< L >::internal_loop ( DISPATCH  dispatch,
l4_utcb_t utcb 
)
inline

The server loop.

This function usually never returns, it waits for incoming messages calls the dispatcher, sends a reply and waits again.

Definition at line 405 of file ipc_server_loop.

References l4_msgtag_t::has_error(), L4_ENOREPLY, and l4_msgtag().

Referenced by L4::Server< LOOP_HOOKS >::loop(), L4::Server< LOOP_HOOKS >::loop_dbg(), and L4::Server< LOOP_HOOKS >::loop_noexc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loop()

template<typename LOOP_HOOKS = Ipc_svr::Default_loop_hooks>
template<typename EXC , typename R >
L4_NORETURN void L4::Server< LOOP_HOOKS >::loop ( r,
l4_utcb_t u = l4_utcb() 
)
inline

Server loop with internal exception handling.

This server loop translates L4::Runtime_error exceptions into negative error return codes sent to the caller.

Definition at line 355 of file ipc_server_loop.

References L4::Server< LOOP_HOOKS >::internal_loop().

+ Here is the call graph for this function:

◆ loop_dbg()

template<typename LOOP_HOOKS = Ipc_svr::Default_loop_hooks>
template<typename EXC , typename R , typename Printer >
L4_NORETURN void L4::Server< LOOP_HOOKS >::loop_dbg ( r,
Printer  p,
l4_utcb_t u = l4_utcb() 
)
inline

Server loop with internal exception handling including message printing.

Exceptions are translated into error codes, just like in loop(). In addition, error messages are printed using the Printer argument.

Definition at line 368 of file ipc_server_loop.

References L4::Server< LOOP_HOOKS >::internal_loop().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: