kernel/timeout: Enable 64 bit timeout precision
Add a CONFIG_TIMEOUT_64BIT kconfig that, when selected, makes the k_ticks_t used in timeout computations pervasively 64 bit. This will allow much longer timeouts and much faster (i.e. more precise) tick rates. It also enables the use of absolute (not delta) timeouts in an upcoming commit. Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
parent
7832738ae9
commit
cfeb07eded
7 changed files with 33 additions and 4 deletions
|
@ -33,7 +33,20 @@ extern "C" {
|
|||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Tick precision used in timeout APIs
|
||||
*
|
||||
* This type defines the word size of the timeout values used in
|
||||
* k_timeout_t objects, and thus defines an upper bound on maximum
|
||||
* timeout length (or equivalently minimum tick duration). Note that
|
||||
* this does not affect the size of the system uptime counter, which
|
||||
* is always a 64 bit count of ticks.
|
||||
*/
|
||||
#ifdef CONFIG_TIMEOUT_64BIT
|
||||
typedef s64_t k_ticks_t;
|
||||
#else
|
||||
typedef u32_t k_ticks_t;
|
||||
#endif
|
||||
|
||||
#define K_TICKS_FOREVER ((k_ticks_t) -1)
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ s32_t z_timeout_remaining(struct _timeout *timeout);
|
|||
#define z_init_thread_timeout(t) do {} while (false)
|
||||
#define z_abort_thread_timeout(t) (0)
|
||||
#define z_is_inactive_timeout(t) 0
|
||||
#define z_get_next_timeout_expiry() (K_TICKS_FOREVER)
|
||||
#define z_get_next_timeout_expiry() ((s32_t) K_TICKS_FOREVER)
|
||||
#define z_set_timeout_expiry(t, i) do {} while (false)
|
||||
|
||||
static inline void z_add_thread_timeout(struct k_thread *th, k_timeout_t ticks)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue