From b32d5554b56e903ca1c3a62bf3f65b924ac38f1d Mon Sep 17 00:00:00 2001 From: Jyri Sarha Date: Fri, 8 Nov 2024 13:17:26 +0200 Subject: [PATCH] drivers: timer: Export sys_clock_cycle_get_64() implementations Export sys_clock_cycle_get_64() implementations to enable k_cycle_get_64() calls from llext libraries. Signed-off-by: Jyri Sarha --- drivers/timer/CMakeLists.txt | 1 + drivers/timer/export.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 drivers/timer/export.c diff --git a/drivers/timer/CMakeLists.txt b/drivers/timer/CMakeLists.txt index 80f0d03e69022e..07b0dd21e72b8f 100644 --- a/drivers/timer/CMakeLists.txt +++ b/drivers/timer/CMakeLists.txt @@ -2,6 +2,7 @@ zephyr_library() zephyr_library_sources(sys_clock_init.c) +zephyr_library_sources_ifdef(CONFIG_LLEXT export.c) zephyr_library_sources_ifdef(CONFIG_ALTERA_AVALON_TIMER altera_avalon_timer_hal.c) zephyr_library_sources_ifdef(CONFIG_AMBIQ_STIMER_TIMER ambiq_stimer.c) zephyr_library_sources_ifdef(CONFIG_APIC_TIMER apic_timer.c) diff --git a/drivers/timer/export.c b/drivers/timer/export.c new file mode 100644 index 00000000000000..a68c4ae41f069f --- /dev/null +++ b/drivers/timer/export.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2024 Intel Corporation + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include +#include +#include + +#ifdef CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER +EXPORT_SYMBOL(sys_clock_cycle_get_64); +#endif