Skip to content

Commit

Permalink
linux-gen: timer: inline odp_timer_current_tick()
Browse files Browse the repository at this point in the history
Inline current tick function as it does not depend on timer
pool structure any more.

Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
  • Loading branch information
psavol committed Dec 11, 2023
1 parent ef4e273 commit 5ceb9fb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 11 additions & 0 deletions platform/linux-generic/include/odp/api/plat/timer_inlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <odp/api/event.h>
#include <odp/api/timer_types.h>

#include <odp/api/abi/time_inlines.h>

#include <odp/api/plat/debug_inlines.h>
#include <odp/api/plat/timer_inline_types.h>

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions platform/linux-generic/odp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 5ceb9fb

Please sign in to comment.