L4Re - L4 Runtime Environment

All kinds of timeouts and time related functions. More...

+ Collaboration diagram for Timeouts:

Data Structures

struct  l4_timeout_s
 Basic timeout specification. More...
 
union  l4_timeout_t
 Timeout pair. More...
 

Macros

#define L4_IPC_TIMEOUT_0   ((l4_timeout_s){0x0400})
 Timeout constants. More...
 
#define L4_IPC_TIMEOUT_NEVER   ((l4_timeout_s){0})
 never timeout
 
#define L4_IPC_NEVER_INITIALIZER   {0}
 never timeout, init
 
#define L4_IPC_NEVER   ((l4_timeout_t){0})
 never timeout
 
#define L4_IPC_RECV_TIMEOUT_0   ((l4_timeout_t){0x00000400})
 0 receive timeout
 
#define L4_IPC_SEND_TIMEOUT_0   ((l4_timeout_t){0x04000000})
 0 send timeout
 
#define L4_IPC_BOTH_TIMEOUT_0   ((l4_timeout_t){0x04000400})
 0 receive and send timeout
 

Typedefs

typedef struct l4_timeout_s l4_timeout_s
 Basic timeout specification. More...
 
typedef union l4_timeout_t l4_timeout_t
 Timeout pair. More...
 

Functions

l4_timeout_s l4_timeout_rel (unsigned man, unsigned exp) L4_NOTHROW
 Get relative timeout consisting of mantissa and exponent. More...
 
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. More...
 
l4_timeout_t l4_timeout (l4_timeout_s snd, l4_timeout_s rcv) L4_NOTHROW
 Combine send and receive timeout in a timeout. More...
 
void l4_snd_timeout (l4_timeout_s snd, l4_timeout_t *to) L4_NOTHROW
 Set send timeout in given to timeout. More...
 
void l4_rcv_timeout (l4_timeout_s rcv, l4_timeout_t *to) L4_NOTHROW
 Set receive timeout in given to timeout. More...
 
l4_kernel_clock_t l4_timeout_rel_get (l4_timeout_s to) L4_NOTHROW
 Get clock value of out timeout. More...
 
unsigned l4_timeout_is_absolute (l4_timeout_s to) L4_NOTHROW
 Return whether the given timeout is absolute or not. More...
 
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. More...
 
l4_timeout_s l4_timeout_abs (l4_kernel_clock_t pint, int br) L4_NOTHROW
 Set an absolute timeout. More...
 
unsigned l4_utcb_mr64_idx (unsigned idx) L4_NOTHROW
 Get index into 64bit message registers alias from native-sized index. More...
 

Detailed Description

All kinds of timeouts and time related functions.

Macro Definition Documentation

◆ L4_IPC_TIMEOUT_0

#define L4_IPC_TIMEOUT_0   ((l4_timeout_s){0x0400})

Timeout constants.

0 timeout

Definition at line 79 of file __timeout.h.

Referenced by L4::Ipc_svr::Timeout_queue_hooks< Br_manager_timeout_hooks, Br_manager >::timeout().

Typedef Documentation

◆ l4_timeout_s

typedef struct l4_timeout_s l4_timeout_s

Basic timeout specification.

Basically a floating point number with 10 bits mantissa and 5 bits exponent (t = m*2^e).

If bit 15 == 1 the timeout is absolute and the lower 6 bits encode the index of the UTCB buffer register(s) holding the absolute 64-bit timeout value. On 32-bit systems, two consecutive UTCB buffer registers are used.

◆ l4_timeout_t

typedef union l4_timeout_t l4_timeout_t

Timeout pair.

For IPC there are usually a send and a receive timeout. So this structure contains a pair of timeouts.

Function Documentation

◆ l4_ipc_timeout()

l4_timeout_t l4_ipc_timeout ( unsigned  snd_man,
unsigned  snd_exp,
unsigned  rcv_man,
unsigned  rcv_exp 
)
inline

Convert explicit timeout values to l4_timeout_t type.

Parameters
snd_manMantissa of send timeout.
snd_expExponent of send timeout.
rcv_manMantissa of receive timeout.
rcv_expExponent of receive timeout.

Definition at line 187 of file __timeout.h.

References l4_timeout_t::p, l4_timeout_t::rcv, l4_timeout_t::snd, and l4_timeout_s::t.

◆ l4_rcv_timeout()

void l4_rcv_timeout ( l4_timeout_s  rcv,
l4_timeout_t to 
)
inline

Set receive timeout in given to timeout.

Parameters
rcvReceive timeout
Return values
toL4 timeout

Definition at line 215 of file __timeout.h.

◆ l4_snd_timeout()

void l4_snd_timeout ( l4_timeout_s  snd,
l4_timeout_t to 
)
inline

Set send timeout in given to timeout.

Parameters
sndSend timeout
Return values
toL4 timeout

Definition at line 208 of file __timeout.h.

◆ l4_timeout()

l4_timeout_t l4_timeout ( l4_timeout_s  snd,
l4_timeout_s  rcv 
)
inline

Combine send and receive timeout in a timeout.

Parameters
sndSend timeout
rcvReceive timeout
Returns
L4 timeout

Definition at line 198 of file __timeout.h.

References l4_timeout_t::p, l4_timeout_t::rcv, l4_timeout_t::snd, and l4_timeout_s::t.

Referenced by L4::Ipc_svr::Timeout_queue_hooks< Br_manager_timeout_hooks, Br_manager >::timeout().

+ Here is the caller graph for this function:

◆ l4_timeout_abs()

l4_timeout_s l4_timeout_abs ( l4_kernel_clock_t  pint,
int  br 
)
inline

Set an absolute timeout.

Parameters
pintPoint in time in clocks
brThe buffer register the timeout shall be placed in. (
Note
On 32bit architectures the timeout needs two consecutive buffers.)
The absolute timeout value will be placed into the buffer register br of the current thread.
Returns
timeout value

Definition at line 383 of file utcb.h.

Referenced by L4::Ipc_svr::Timeout_queue_hooks< Br_manager_timeout_hooks, Br_manager >::timeout().

+ Here is the caller graph for this function:

◆ l4_timeout_get()

l4_kernel_clock_t l4_timeout_get ( l4_kernel_clock_t  cur,
l4_timeout_s  to 
)
inline

Get clock value for a clock + a timeout.

Parameters
curClock value
toL4 timeout
Returns
Clock sum

Definition at line 245 of file __timeout.h.

References l4_timeout_is_absolute(), and l4_timeout_rel_get().

+ Here is the call graph for this function:

◆ l4_timeout_is_absolute()

unsigned l4_timeout_is_absolute ( l4_timeout_s  to)
inline

Return whether the given timeout is absolute or not.

Parameters
toL4 timeout
Returns
!= 0 if absolute, 0 if relative

Definition at line 238 of file __timeout.h.

Referenced by l4_timeout_get().

+ Here is the caller graph for this function:

◆ l4_timeout_rel()

l4_timeout_s l4_timeout_rel ( unsigned  man,
unsigned  exp 
)
inline

Get relative timeout consisting of mantissa and exponent.

Parameters
manMantissa of timeout
expExponent of timeout
Returns
timeout value

Definition at line 222 of file __timeout.h.

◆ l4_timeout_rel_get()

l4_kernel_clock_t l4_timeout_rel_get ( l4_timeout_s  to)
inline

Get clock value of out timeout.

Parameters
toL4 timeout
Returns
Clock value

Definition at line 229 of file __timeout.h.

Referenced by l4_timeout_get().

+ Here is the caller graph for this function:

◆ l4_utcb_mr64_idx()

unsigned l4_utcb_mr64_idx ( unsigned  idx)
inline

Get index into 64bit message registers alias from native-sized index.

Parameters
idxIndex to native-sized message register
Returns
Index to 64bit message register alias

Definition at line 386 of file utcb.h.

References __END_DECLS.