API Reference Manual  1.46.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-2023 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 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
20 #include <odp/api/event_types.h>
21 #include <odp/api/std_types.h>
22 
70 typedef enum {
73 
76 
78 
82 typedef struct {
84  uint64_t res_ns;
85 
87  uint64_t res_hz;
88 
90  uint64_t min_tmo;
91 
93  uint64_t max_tmo;
94 
96 
100 typedef struct {
111 
113  uint64_t max_multiplier;
114 
116  uint64_t res_ns;
117 
119 
123 typedef struct {
130 
132  uint32_t max_pools;
133 
138  uint32_t max_timers;
139 
148  uint64_t highest_res_ns;
149 
162 
175 
186 
197 
199  struct {
204  uint32_t max_pools;
205 
207  uint32_t max_timers;
208 
211 
214 
215  } periodic;
216 
218 
226 typedef enum {
229 
232 
235 
238 
241 
244 
247 
249 
251 #define ODP_CLOCK_DEFAULT ODP_CLOCK_SRC_0
252 
262 typedef enum {
268 
277 
279 
283 typedef struct {
293 
298 
303 
308  uint64_t res_ns;
309 
313  uint64_t res_hz;
314 
323  uint64_t min_tmo;
324 
333  uint64_t max_tmo;
334 
339  struct {
362 
368  uint64_t max_multiplier;
369 
370  } periodic;
371 
373  uint32_t num_timers;
374 
378  int priv;
379 
381 
385 typedef enum {
392 
398 
400 
404 typedef struct odp_timer_start_t {
410 
415  uint64_t tick;
416 
427 
429 
473  uint64_t first_tick;
474 
485  uint64_t freq_multiplier;
486 
493 
495 
499 typedef enum {
506 
515 
523 
530  ODP_TIMER_FAIL = -3
531 
533 
537 typedef struct odp_timer_tick_info_t {
550 
563 
579 
581 
585 typedef struct {
588 
590  uint32_t cur_timers;
591 
593  uint32_t hwm_timers;
594 
596  const char *name;
597 
600 
602 
607 #ifdef __cplusplus
608 }
609 #endif
610 
611 #include <odp/visibility_end.h>
612 #endif
ODP event API type definitions.
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_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
Periodic timer.
@ 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.
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)
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.
odp_bool_t queue_type_plain
Plain queue destination support.
uint64_t highest_res_ns
Highest timer resolution in nanoseconds.
odp_bool_t queue_type_sched
Scheduled queue destination support.
Periodic timer capability.
odp_fract_u64_t base_freq_hz
Periodic timer pool base frequency in hertz.
uint64_t res_ns
Timeout resolution in nanoseconds.
uint64_t max_multiplier
Maximum base frequency multiplier.
Periodic timer start parameters.
odp_event_t tmo_ev
Timeout event.
uint64_t freq_multiplier
Base frequency multiplier.
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_timer_type_t timer_type
Timer type.
uint64_t max_multiplier
Maximum base frequency multiplier.
odp_fract_u64_t base_freq_hz
Timer pool base frequency in hertz.
int priv
Thread private timer pool.
uint64_t min_tmo
Minimum relative timeout in nanoseconds.
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.