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
11 changes: 9 additions & 2 deletions libplatsupport/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,18 @@ mark_as_advanced(CLEAR LibPlatSupportX86ConsoleDevice LibPlatSupportLPTMRclock)

# Some platforms don't have a platform timer.
if(KernelPlatformCheshire)
config_set(LibPlatSupportNoPlatformLtimer LIB_PLAT_SUPPORT_NO_PLATFORM_LTIMER ON)
set(LibPlatSupportHaveTimer OFF)
else()
config_set(LibPlatSupportNoPlatformLtimer LIB_PLAT_SUPPORT_NO_PLATFORM_LTIMER OFF)
set(LibPlatSupportHaveTimer ON)
endif()

config_option(
LibPlatSupportHaveTimer LIB_PLAT_SUPPORT_HAVE_TIMER
"Indicates that this platform has support for platform ltimers"
)

mark_as_advanced(LibPlatSupportHaveTimer)

set(LibPlatSupportMach "")
if(KernelPlatformRpi3 OR KernelPlatformRpi4)
set(LibPlatSupportMach "bcm")
Expand Down
4 changes: 2 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);
}

#ifndef CONFIG_LIB_PLAT_SUPPORT_NO_PLATFORM_LTIMER
#ifdef CONFIG_LIB_PLAT_SUPPORT_HAVE_TIMER
/*
* default init function -> platforms may provide multiple ltimers, but each
* must have a default
Expand All @@ -330,4 +330,4 @@ int ltimer_default_init(ltimer_t *timer, ps_io_ops_t ops, ltimer_callback_fn_t c
* the resources this ltimer needs without initialising the actual timer
* drivers*/
int ltimer_default_describe(ltimer_t *timer, ps_io_ops_t ops);
#endif /* CONFIG_LIB_PLAT_SUPPORT_NO_PLATFORM_LTIMER*/
#endif /* CONFIG_LIB_PLAT_SUPPORT_HAVE_TIMER*/