API Reference Manual  1.50.0
api/spec/timer_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2013-2018 Linaro Limited
3  * Copyright (c) 2019-2026 Nokia
4  */
5 
12 #ifndef ODP_API_SPEC_TIMER_TYPES_H_
13 #define ODP_API_SPEC_TIMER_TYPES_H_
14 #include <odp/visibility_begin.h>
15 
16 #include <odp/api/event_types.h>
17 #include <odp/api/queue_types.h>
18 #include <odp/api/std_types.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
73 typedef enum {
76 
79 
82 
84 
88 typedef struct {
90  uint64_t res_ns;
91 
93  uint64_t res_hz;
94 
96  uint64_t min_tmo;
97 
99  uint64_t max_tmo;
100 
102 
106 typedef struct {
112 
114  union {
116  struct {
127 
129  uint64_t max_multiplier;
130 
131  } base_mul;
132 
134  struct {
139 
141  uint32_t num;
142 
143  } freq;
144 
145  };
146 
148  uint64_t res_ns;
149 
151 
155 typedef struct {
162 
164  uint32_t max_pools;
165 
167  uint16_t max_priority;
168 
173  uint32_t max_timers;
174 
183  uint64_t highest_res_ns;
184 
197 
210 
221 
232 
234  struct {
236  struct {
238  uint32_t base_mul : 1;
239 
241  uint32_t freq : 1;
242 
243  } support;
244 
246  uint32_t max_pools;
247 
249  uint16_t max_priority;
250 
252  uint32_t max_timers;
253 
260 
267 
274 
281 
283  uint32_t min_pending_tmo;
284 
287  uint32_t max_pending_tmo;
288 
289  } periodic;
290 
292 
300 typedef enum {
303 
306 
309 
312 
315 
318 
321 
323 
325 #define ODP_CLOCK_DEFAULT ODP_CLOCK_SRC_0
326 
336 typedef enum {
342 
351 
353 
357 typedef struct {
368 
373 
378 
383  uint64_t res_ns;
384 
388  uint64_t res_hz;
389 
398  uint64_t min_tmo;
399 
408  uint64_t max_tmo;
409 
414  struct {
447  struct {
467 
474  uint64_t max_multiplier;
475 
476  } base_mul;
477 
485  struct {
504 
506  uint32_t num;
507 
508  } freq;
509 
516  uint32_t uarea_size;
517 
530  uint32_t max_pending_tmo;
531 
532  } periodic;
533 
535  uint32_t num_timers;
536 
545  uint16_t priority;
546 
550  int priv;
551 
553 
557 typedef struct {
564 
570  const void *user_ptr;
571 
573  struct {
586  uint64_t multiplier;
587 
588  } base_mul;
589 
591  struct {
599 
600  } freq;
601 
603  struct {
617  void (*init_fn)(void *uarea, uint32_t size, void *args, uint32_t index,
618  uint32_t max_num);
619 
623  void *args;
624 
625  } uarea_init;
626 
628 
632 typedef enum {
639 
645 
647 
651 typedef struct odp_timer_start_t {
657 
662  uint64_t tick;
663 
674 
676 
695  uint64_t first_tick;
696 
698 
702 typedef enum {
709 
718 
726 
734 
741  ODP_TIMER_FAIL = -4
742 
744 
748 typedef struct odp_timer_tick_info_t {
761 
774 
790 
792 
796 typedef struct {
799 
801  uint32_t cur_timers;
802 
804  uint32_t hwm_timers;
805 
807  const char *name;
808 
811 
813 
818 #ifdef __cplusplus
819 }
820 #endif
821 
822 #include <odp/visibility_end.h>
823 #endif
ODP event API type definitions.
ODP queue.
Standard C language types and definitions for ODP.
bool odp_bool_t
Boolean type.
struct odp_timer_periodic_start_t odp_timer_periodic_start_t
Periodic timer start parameters.
struct odp_timer_start_t odp_timer_start_t
Timer start parameters.
odp_timer_clk_src_t
Clock sources for timer pools.
odp_timer_retval_t
Return values for timer start, restart and cancel calls.
odp_timer_type_t
Timer type.
struct odp_timer_tick_info_t odp_timer_tick_info_t
Timer tick information.
odp_timer_exp_mode_t
Timer expiration mode.
odp_timer_tick_type_t
Timer tick type.
@ ODP_CLOCK_SRC_1
Clock source number 1.
@ ODP_CLOCK_SRC_3
Clock source number 3
@ ODP_CLOCK_SRC_2
Clock source number 2.
@ ODP_CLOCK_NUM_SRC
Number of clock source enumerations.
@ ODP_CLOCK_SRC_5
Clock source number 5
@ ODP_CLOCK_SRC_4
Clock source number 4
@ ODP_CLOCK_SRC_0
Clock source number 0.
@ ODP_TIMER_BUSY
Timer operation failed, resources temporarily busy.
@ ODP_TIMER_SUCCESS
Timer operation succeeded.
@ ODP_TIMER_TOO_NEAR
Timer operation failed, too near to the current time.
@ ODP_TIMER_TOO_FAR
Timer operation failed, too far from the current time.
@ ODP_TIMER_FAIL
Timer operation failed.
@ ODP_TIMER_TYPE_PERIODIC_BASE_MUL
Periodic timer, period defined through pool base frequency and a multiplier.
@ ODP_TIMER_TYPE_PERIODIC_FREQ
Periodic timer, period defined directly with frequency.
@ ODP_TIMER_TYPE_SINGLE
Single shot timer.
@ ODP_TIMER_EXP_RELAXED
Expiration relaxed.
@ ODP_TIMER_EXP_AFTER
Expiration after the target time.
@ ODP_TIMER_TICK_REL
Relative ticks.
@ ODP_TIMER_TICK_ABS
Absolute ticks.
Unsigned 64 bit fractional number.
odp_fract_u64_t min_base_freq_hz
Minimum supported base frequency value.
uint16_t max_priority
Maximum single shot timer pool priority.
uint32_t max_pending_tmo
Maximum value for odp_timer_pool_param_t::periodic::max_pending_tmo.
uint32_t max_timers
Maximum number of single shot timers in a pool.
uint32_t max_pools_combined
Maximum number of timer pools.
uint32_t max_pools
Maximum number of timer pools for single shot timers (per clock source)
uint32_t freq
ODP_TIMER_TYPE_PERIODIC_FREQ supported.
odp_timer_res_capability_t max_tmo
Maximum timeout length.
odp_fract_u64_t max_base_freq_hz
Maximum supported base frequency value.
odp_timer_res_capability_t max_res
Maximum resolution.
uint32_t min_pending_tmo
Minimum value for odp_timer_pool_param_t::periodic::max_pending_tmo.
odp_bool_t queue_type_plain
Plain queue destination support.
odp_fract_u64_t max_freq_hz
Maximum supported periodic timer frequency value.
uint32_t base_mul
ODP_TIMER_TYPE_PERIODIC_BASE_MUL supported.
uint64_t highest_res_ns
Highest timer resolution in nanoseconds.
odp_bool_t queue_type_sched
Scheduled queue destination support.
odp_fract_u64_t min_freq_hz
Minimum supported periodic timer frequency value.
Periodic timer capability.
uint32_t num
Number of items in 'freq_hz' array.
odp_fract_u64_t * freq_hz
Array of constraining periodic timer frequencies for timer pool in hertz in ascending order.
odp_fract_u64_t base_freq_hz
Periodic timer pool base frequency in hertz.
uint64_t res_ns
Timeout resolution in nanoseconds.
odp_timer_type_t type
Periodic timer type for which to check the frequency support.
uint64_t max_multiplier
Maximum base frequency multiplier.
Periodic timer parameters.
void * args
Pointer to application defined arguments to be passed to every call of 'init_fn'.
const void * user_ptr
User pointer.
odp_queue_t queue
Destination queue.
uint64_t multiplier
Base frequency multiplier.
odp_fract_u64_t freq_hz
Timer frequency in hertz.
Periodic timer start parameters.
uint64_t first_tick
First expiration time.
ODP timer pool information and configuration.
odp_timer_tick_info_t tick_info
Timer pool tick information.
uint32_t hwm_timers
High watermark of allocated timers.
uint32_t cur_timers
Number of currently allocated timers.
odp_timer_pool_param_t param
Parameters specified at creation.
const char * name
Name of timer pool.
Timer pool parameters.
uint64_t res_ns
Timeout resolution in nanoseconds.
uint64_t res_hz
Timeout resolution in hertz.
odp_fract_u64_t * freq_hz
Array of constraining periodic timer frequencies for the pool in hertz in ascending order.
odp_timer_type_t timer_type
Timer type.
uint32_t num
Number of items in 'freq_hz' array.
uint64_t max_multiplier
Maximum base frequency multiplier.
uint32_t max_pending_tmo
Maximum number of pending timeout events.
odp_fract_u64_t base_freq_hz
Timer pool base frequency in hertz.
uint16_t priority
Timer pool priority.
int priv
Thread private timer pool.
uint64_t min_tmo
Minimum relative timeout in nanoseconds.
uint32_t uarea_size
Minimum user area size in bytes.
uint32_t num_timers
Number of timers in the pool.
odp_timer_exp_mode_t exp_mode
Timer expiration mode.
odp_timer_clk_src_t clk_src
Clock source for timers.
uint64_t max_tmo
Maximum relative timeout in nanoseconds.
Timer resolution capability.
uint64_t res_hz
Timeout resolution in hertz.
uint64_t max_tmo
Maximum relative timeout in nanoseconds.
uint64_t min_tmo
Minimum relative timeout in nanoseconds.
uint64_t res_ns
Timeout resolution in nanoseconds.
Timer start parameters.
uint64_t tick
Expiration time in ticks.
odp_event_t tmo_ev
Timeout event.
odp_timer_tick_type_t tick_type
Tick type.
Timer tick information.
odp_fract_u64_t clk_cycle
One timer tick in source clock cycles.
odp_fract_u64_t freq
Timer tick frequency in hertz.
odp_fract_u64_t nsec
One timer tick in nanoseconds.