@@ -200,6 +200,15 @@ int odp_timer_pool_info(odp_timer_pool_t tpid,
uint64_t odp_timer_pool_resolution(odp_timer_pool_t tpid);
/**
+ * Get timer pool from timer
+ *
+ * @param tim Timer handle
+ *
+ * @return Timer pool handle
+ */
+odp_timer_pool_t odp_timer_pool_from_timer(odp_timer_t tim);
+
+/**
* Allocate a timer
*
* Create a timer (allocating all necessary resources e.g. timeout event) from
@@ -842,6 +842,11 @@ uint64_t odp_timer_pool_resolution(odp_timer_pool_t tpid)
return tpid->param.res_ns;
}
+odp_timer_pool_t odp_timer_pool_from_timer(odp_timer_t tim)
+{
+ return handle_to_tp(tim);
+}
+
uint64_t odp_timer_pool_to_u64(odp_timer_pool_t tpid)
{
return _odp_pri(tpid);
@@ -231,6 +231,8 @@ static void handle_tmo(odp_event_t ev, bool stale, uint64_t prev_tick)
uint64_t tick = odp_timeout_tick(tmo);
struct test_timer *ttp = odp_timeout_user_ptr(tmo);
+ CU_ASSERT(odp_timer_pool_from_timer(tim) == tp);
+
if (tim == ODP_TIMER_INVALID)
CU_FAIL("odp_timeout_timer() invalid timer");
if (!ttp)
Signed-off-by: Brian Brooks <brian.brooks@linaro.org> --- include/odp/api/spec/timer.h | 9 +++++++++ platform/linux-generic/odp_timer.c | 5 +++++ test/common_plat/validation/api/timer/timer.c | 2 ++ 3 files changed, 16 insertions(+) -- 2.7.4