L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches

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.
 
#define L4_IPC_TIMEOUT_NEVER   ((l4_timeout_s){0})
 never timeout
 
#define L4_IPC_NEVER_INITIALIZER   {0}
 never timeout, initializer
 
#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
 
#define L4_TIMEOUT_US_NEVER   (~0U)
 The waiting period in microseconds which is interpreted as "never" by l4_timeout_from_us().
 
#define L4_TIMEOUT_US_MAX   (~0U - 1)
 The longest waiting period in microseconds accepted by l4_timeout_from_us().
 

Typedefs

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

Functions

l4_timeout_s l4_timeout_rel (unsigned man, unsigned exp) L4_NOTHROW
 Get relative timeout consisting of mantissa and exponent.
 
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.
 
l4_timeout_t l4_timeout (l4_timeout_s snd, l4_timeout_s rcv) L4_NOTHROW
 Combine send and receive timeout in a timeout.
 
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_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_s l4_timeout_abs (l4_kernel_clock_t pint, int br) L4_NOTHROW
 Set an absolute timeout.
 
unsigned l4_utcb_mr64_idx (unsigned idx) L4_NOTHROW
 Get index into 64bit message registers alias from native-sized index.
 

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.

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 208 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
[out]toL4 timeout

Definition at line 236 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
[out]toL4 timeout

Definition at line 229 of file __timeout.h.

References l4_timeout_t::p, and l4_timeout_t::snd.

◆ 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 219 of file __timeout.h.

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

Referenced by l4_ipc_sleep_ms(), l4_ipc_sleep_us(), and L4::Ipc_svr::Timeout_queue_hooks< HOOKS, BR_MAN >::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.

References l4_utcb().

Referenced by L4::Ipc_svr::Timeout_queue_hooks< HOOKS, BR_MAN >::timeout().

+ Here is the call graph for this function:
+ 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 266 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 259 of file __timeout.h.

References l4_timeout_s::t.

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 243 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 250 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.

Referenced by l4_icu_msi_info_u().

+ Here is the caller graph for this function: