Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion libplatsupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 8 additions & 2 deletions libplatsupport/include/platsupport/ltimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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*/