diff --git a/platform/linux-generic/include/odp/api/plat/timer_inlines.h b/platform/linux-generic/include/odp/api/plat/timer_inlines.h index 9ba0287e08..d2982079f9 100644 --- a/platform/linux-generic/include/odp/api/plat/timer_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/timer_inlines.h @@ -10,6 +10,8 @@ #include #include +#include + #include #include @@ -24,6 +26,7 @@ #define odp_timeout_tick __odp_timeout_tick #define odp_timeout_user_ptr __odp_timeout_user_ptr #define odp_timeout_user_area __odp_timeout_user_area + #define odp_timer_current_tick __odp_timer_current_tick #define odp_timer_tick_to_ns __odp_timer_tick_to_ns #define odp_timer_ns_to_tick __odp_timer_ns_to_tick #define odp_timeout_from_event __odp_timeout_from_event @@ -53,6 +56,14 @@ _ODP_INLINE void *odp_timeout_user_area(odp_timeout_t tmo) return _odp_timeout_hdr_field(tmo, void *, uarea_addr); } +_ODP_INLINE uint64_t odp_timer_current_tick(odp_timer_pool_t tpid) +{ + (void)tpid; + + /* This is equal to odp_time_global_ns(). Cannot call inlined API function from here. */ + return _odp_time_to_ns(_odp_time_cur()); +} + _ODP_INLINE uint64_t odp_timer_tick_to_ns(odp_timer_pool_t tp, uint64_t ticks) { (void)tp; diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 9cc3058169..986875c6f1 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -1451,13 +1451,6 @@ void odp_timer_pool_destroy(odp_timer_pool_t tpid) odp_timer_pool_del(timer_pool_from_hdl(tpid)); } -uint64_t odp_timer_current_tick(odp_timer_pool_t tpid) -{ - (void)tpid; - - return odp_time_global_ns(); -} - int odp_timer_sample_ticks(odp_timer_pool_t timer_pool[], uint64_t tick[], uint64_t clk_count[], int num) {