diff --git a/libplatsupport/CMakeLists.txt b/libplatsupport/CMakeLists.txt index 4d7810d57..70bcc197b 100644 --- a/libplatsupport/CMakeLists.txt +++ b/libplatsupport/CMakeLists.txt @@ -55,8 +55,11 @@ else() endif() config_option( - LibPlatSupportHaveTimer LIB_PLAT_SUPPORT_HAVE_TIMER + LibPlatSupportHaveTimer + LIB_PLAT_SUPPORT_HAVE_TIMER "Indicates that this platform has support for platform ltimers" + DEFAULT + ON ) mark_as_advanced(LibPlatSupportHaveTimer) diff --git a/libplatsupport/include/platsupport/ltimer.h b/libplatsupport/include/platsupport/ltimer.h index 2c27cee8b..73749e990 100644 --- a/libplatsupport/include/platsupport/ltimer.h +++ b/libplatsupport/include/platsupport/ltimer.h @@ -315,7 +315,7 @@ static inline void ltimer_us_delay(ltimer_t *timer, uint64_t microseconds) ltimer_ns_delay(timer, microseconds * NS_IN_US); } -#ifdef CONFIG_LIB_PLAT_SUPPORT_HAVE_TIMER + /* * default init function -> platforms may provide multiple ltimers, but each * must have a default @@ -325,9 +325,15 @@ static inline void ltimer_us_delay(ltimer_t *timer, uint64_t microseconds) * with calling the ltimer functions inside the callback, the ltimer interface * functions are not reentrant. */ +#ifndef CONFIG_LIB_PLAT_SUPPORT_HAVE_TIMER +__attribute__((error("no ltimer support for this platform"))) +#endif int ltimer_default_init(ltimer_t *timer, ps_io_ops_t ops, ltimer_callback_fn_t callback, void *callback_token); + /* initialise the subset of functions required to get * the resources this ltimer needs without initialising the actual timer * drivers*/ +#ifndef CONFIG_LIB_PLAT_SUPPORT_HAVE_TIMER +__attribute__((error("no ltimer support for this platform"))) +#endif int ltimer_default_describe(ltimer_t *timer, ps_io_ops_t ops); -#endif /* CONFIG_LIB_PLAT_SUPPORT_HAVE_TIMER*/