11 #include <l4/cxx/hlist> 12 #include <l4/sys/cxx/ipc_server_loop> 14 namespace L4 {
namespace Ipc_svr {
68 if (
auto e = _timeouts.front())
85 return (next != 0) && (next <= now);
94 while (!_timeouts.empty())
96 Queue::Iterator top = _timeouts.begin();
97 if ((*top)->_timeout > now)
101 top = _timeouts.erase(top);
114 timeout->_timeout = time;
115 Queue::Iterator i = _timeouts.begin();
116 while (i != _timeouts.end() && (*i)->timeout() < time)
119 _timeouts.insert_before(timeout, i);
150 template<
typename HOOKS,
typename BR_MAN = Br_manager_no_buffers >
154 {
return static_cast<HOOKS*
>(
this)->now(); }
156 unsigned _timeout_br()
157 {
return this->first_free_br(); }
177 if (queue.timeout_expired(now))
178 queue.handle_expired_timeouts(now);
181 BR_MAN::setup_wait(utcb, mode);
188 if (queue.timeout_expired(_now()))
205 queue.add(timeout, time);
218 queue.remove(timeout);
l4_timeout_t l4_timeout(l4_timeout_s snd, l4_timeout_s rcv) L4_NOTHROW
Combine send and receive timeout in a timeout.
Reply_mode
Reply mode for server loop.
Server shall call reply and wait separately.
L4::Ipc_svr::Reply_mode before_reply(l4_msgtag_t, l4_utcb_t *)
server loop hook
void handle_expired_timeouts(l4_kernel_clock_t now)
run the callbacks of expired timeouts
Timeout queue to be used in l4re server loop.
L4 low-level kernel interface.
L4::Ipc_svr::Timeout Timeout
Provide a local definition of Timeout for backward compat.
void setup_wait(l4_utcb_t *utcb, L4::Ipc_svr::Reply_mode mode)
setup_wait() for the server loop
l4_kernel_clock_t timeout() const
return absolute timeout of this callback.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Callback interface for Timeout_queue.
l4_timeout_s l4_timeout_abs(l4_kernel_clock_t pint, int br) L4_NOTHROW
Set an absolute timeout.
l4_kernel_clock_t next_timeout() const
Get the time for the next timeout.
bool timeout_expired(l4_kernel_clock_t now) const
Determine if a timeout has happened.
virtual ~Timeout()=0
Destroy a timeout.
Basic element type for a double-linked H_list.
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
Timeout_queue queue
Use this timeout queue.
virtual void expired()=0
callback function to be called when timeout happened
int add_timeout(Timeout *timeout, l4_kernel_clock_t time)
Add a timout to the queue for time time.
l4_timeout_t timeout()
get the time for the next timeout
int remove_timeout(Timeout *timeout)
Remove timeout from the queue.
#define L4_IPC_SEND_TIMEOUT_0
0 send timeout
void add(Timeout *timeout, l4_kernel_clock_t time)
Add a timeout to the queue.
#define L4_IPC_TIMEOUT_0
Timeout constants.
Message tag data structure.
Loop hooks mixin for integrating a timeout queue into the server loop.
Server shall use a compound reply and wait (fast).