25#ifndef L4_SYS_TIMEOUT_H__
26#define L4_SYS_TIMEOUT_H__
28#include <l4/sys/l4int.h>
79#define L4_IPC_TIMEOUT_0 ((l4_timeout_s){0x0400})
80#define L4_IPC_TIMEOUT_NEVER ((l4_timeout_s){0})
81#define L4_IPC_NEVER_INITIALIZER {0}
82#define L4_IPC_NEVER ((l4_timeout_t){0})
83#define L4_IPC_RECV_TIMEOUT_0 ((l4_timeout_t){0x00000400})
84#define L4_IPC_SEND_TIMEOUT_0 ((l4_timeout_t){0x04000000})
85#define L4_IPC_BOTH_TIMEOUT_0 ((l4_timeout_t){0x04000400})
91#define L4_TIMEOUT_US_NEVER (~0U)
96#define L4_TIMEOUT_US_MAX (~0U - 1)
124 unsigned rcv_man,
unsigned rcv_exp)
L4_NOTHROW;
209 unsigned rcv_man,
unsigned rcv_exp)
L4_NOTHROW
212 t.
p.
snd.
t = (snd_man & 0x3ff) | ((snd_exp << 10) & 0x7c00);
213 t.
p.
rcv.
t = (rcv_man & 0x3ff) | ((rcv_exp << 10) & 0x7c00);
261 return to.
t & 0x8000;
277 static_assert(
sizeof(us) <= 4,
278 "Verify the correctness of log2(us) and the number of bits for e!");
289 int e = (31 - __builtin_clz(us)) - 9;
l4_uint64_t l4_kernel_clock_t
Kernel clock type.
unsigned int l4_uint32_t
Unsigned 32bit value.
unsigned short int l4_uint16_t
Unsigned 16bit value.
#define L4_IPC_TIMEOUT_NEVER
never timeout
l4_timeout_t l4_ipc_timeout(unsigned snd_man, unsigned snd_exp, unsigned rcv_man, unsigned rcv_exp) L4_NOTHROW
Convert explicit timeout values to l4_timeout_t type.
#define L4_IPC_TIMEOUT_0
Timeout constants.
l4_kernel_clock_t l4_timeout_get(l4_kernel_clock_t cur, l4_timeout_s to) L4_NOTHROW
Get clock value for a clock + a timeout.
l4_timeout_t l4_timeout(l4_timeout_s snd, l4_timeout_s rcv) L4_NOTHROW
Combine send and receive timeout in a timeout.
#define L4_TIMEOUT_US_NEVER
The waiting period in microseconds which is interpreted as "never" by l4_timeout_from_us().
void l4_snd_timeout(l4_timeout_s snd, l4_timeout_t *to) L4_NOTHROW
Set send timeout in given to timeout.
void l4_rcv_timeout(l4_timeout_s rcv, l4_timeout_t *to) L4_NOTHROW
Set receive timeout in given to timeout.
l4_kernel_clock_t l4_timeout_rel_get(l4_timeout_s to) L4_NOTHROW
Get clock value of out timeout.
unsigned l4_timeout_is_absolute(l4_timeout_s to) L4_NOTHROW
Return whether the given timeout is absolute or not.
l4_timeout_s l4_timeout_rel(unsigned man, unsigned exp) L4_NOTHROW
Get relative timeout consisting of mantissa and exponent.
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
#define L4_INLINE
L4 Inline function attribute.
Basic timeout specification.
l4_uint16_t t
timeout value
struct l4_timeout_t::@16 p
combined timeout
l4_timeout_s snd
send timeout
l4_timeout_s rcv
receive timeout