diff options
author | Kevin Wang <kevin.wang@arm.com> | 2017-07-20 11:43:23 +0800 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2017-12-27 21:58:42 +0300 |
commit | 90105d86a883b06bb8b72f8bc0f3a145fb8842de (patch) | |
tree | 46c8b48d5ba9904b4fbb6cd0b7ddd57edc3eb2cf /include/odp/api/spec/timer.h | |
parent | b6ac7022bcc2d1acb886109015ac41ada725038e (diff) |
api: timer: add odp_timer_capability() api
Currently, user needs to decide the timer resolution before creating
a timer pool. But sometimes it will cause timer overrun as the system
can't support such high resolution.
So a new API is required to expose the timer capability to the user.
Signed-off-by: Kevin Wang <kevin.wang@arm.com>
Reviewed-by: Brian Brooks <brian.brooks@arm.com>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/spec/timer.h')
-rw-r--r-- | include/odp/api/spec/timer.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/odp/api/spec/timer.h b/include/odp/api/spec/timer.h index d846618f9..17daafc78 100644 --- a/include/odp/api/spec/timer.h +++ b/include/odp/api/spec/timer.h @@ -132,6 +132,33 @@ typedef struct { } odp_timer_pool_param_t; /** + * Timer capability + */ +typedef struct { + /** Highest timer resolution in nanoseconds. + * + * This defines the highest resolution supported by a timer. + * It's the minimum valid value for 'res_ns' timer pool + * parameter. + */ + uint64_t highest_res_ns; +} odp_timer_capability_t; + +/** + * Query timer capabilities + * + * Outputs timer capabilities on success. + * + * @param clk_src Clock source for timers + * @param[out] capa Pointer to capability structure for output + * + * @retval 0 on success + * @retval <0 on failure + */ +int odp_timer_capability(odp_timer_clk_src_t clk_src, + odp_timer_capability_t *capa); + +/** * Create a timer pool * * The use of pool name is optional. Unique names are not required. |