From 641c7c094cf349ed75ae0e27fc025cba859f44d4 Mon Sep 17 00:00:00 2001 From: julia Date: Fri, 30 May 2025 12:12:11 +1000 Subject: [PATCH] export LibPlatSupportHaveTimer instead of inverse As suggested by Indan to be clearer to understand. https://github.com/seL4/util_libs/pull/196#issuecomment-2918974119 Signed-off-by: julia --- libplatsupport/CMakeLists.txt | 11 +++++++++-- libplatsupport/include/platsupport/ltimer.h | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libplatsupport/CMakeLists.txt b/libplatsupport/CMakeLists.txt index 8a7774cd7..4d7810d57 100644 --- a/libplatsupport/CMakeLists.txt +++ b/libplatsupport/CMakeLists.txt @@ -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") diff --git a/libplatsupport/include/platsupport/ltimer.h b/libplatsupport/include/platsupport/ltimer.h index d8e87df33..2c27cee8b 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); } -#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 @@ -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*/