@@ -191,6 +191,15 @@ int odp_timer_pool_info(odp_timer_pool_t tpid,
odp_timer_pool_info_t *info);
/**
+ * Get resolution from timer pool
+ *
+ * @param tpid Timer pool identifier
+ *
+ * @return Timeout resolution in nanoseconds
+ */
+uint64_t odp_timer_pool_resolution(odp_timer_pool_t tpid);
+
+/**
* Allocate a timer
*
* Create a timer (allocating all necessary resources e.g. timeout event) from
@@ -837,6 +837,11 @@ int odp_timer_pool_info(odp_timer_pool_t tpid,
return 0;
}
+uint64_t odp_timer_pool_resolution(odp_timer_pool_t tpid)
+{
+ return tpid->param.res_ns;
+}
+
uint64_t odp_timer_pool_to_u64(odp_timer_pool_t tpid)
{
return _odp_pri(tpid);
@@ -529,6 +529,8 @@ void timer_test_odp_timer_all(void)
CU_ASSERT(tpinfo.param.max_tmo == MAX);
CU_ASSERT(strcmp(tpinfo.name, NAME) == 0);
+ CU_ASSERT(odp_timer_pool_resolution(tp) == RES);
+
LOG_DBG("Timer pool handle: %" PRIu64 "\n", odp_timer_pool_to_u64(tp));
LOG_DBG("#timers..: %u\n", NTIMERS);
LOG_DBG("Tmo range: %u ms (%" PRIu64 " ticks)\n", RANGE_MS,
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