You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sys: clock: additional constants and macros for timespec conversion
Define additional constants and macros for converting between timespec
objects and k_timeout_t.
There are four semantically important durations identified with new
constants identified via '.
1. K_NO_WAIT / K_TS_NO_WAIT'
* duration of zero
2. K_TICK_MIN' / K_TS_MIN'
* minimum number of ticks strictly greater than K_NO_WAIT
3. K_TICK_MAX' / K_TS_MAX'
* maximum number of ticks strictly and semantically less than K_FOREVER
4. K_FOREVER / K_TS_FOREVER'
* the familiar non-expiring number of ticks (i.e. infinity)
With these definitions, there are 3 meaningful regions for conversion
between timespec and k_timeout_t representation:
1. < K_TS_NO_WAIT (i.e. a negative timespec)
* should be rounded up to K_TS_NO_WAIT
* < K_NO_WAIT in ticks is an absolute time point in 64-bit
representation should no be permitted in the affected conversion
routines, as they are explicitly for converting time durations rather
than absolute time points.
2. K_TS_NO_WAIT < x < K_TS_MAX
* should be rounded-up to the next tick boundary
* must be represented as the minimal non-zero duration in ticks
3. K_TS_MAX <= x < K_TS_FOREVER
* must be represented as the maximum expiring duration in ticks
* should be rounded-down to K_TS_MAX
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
0 commit comments