Skip to content

Commit 2f5e939

Browse files
aescolarjhedberg
authored andcommitted
Revert "kernel: retrieve system timer clock frequency at runtime or static"
This reverts commit 7c03e5d. zephyrproject-rtos#69705 Introduced a regression in main in which tests/subsys/logging/log_timestamp started failing. (See zephyrproject-rtos#72344 for more info). Let's revert the PR. It can be submitted after with the issue fixed. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent 33c253c commit 2f5e939

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

include/zephyr/sys_clock.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ typedef struct {
146146

147147
/** @endcond */
148148

149-
#if defined(CONFIG_SYS_CLOCK_EXISTS) && !defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
150-
BUILD_ASSERT(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC != 0,
151-
"SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!");
149+
#if defined(CONFIG_SYS_CLOCK_EXISTS) && \
150+
(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0)
151+
#error "SYS_CLOCK_HW_CYCLES_PER_SEC must be non-zero!"
152152
#endif
153153

154154

@@ -164,7 +164,7 @@ BUILD_ASSERT(CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC != 0,
164164
* @{
165165
*/
166166

167-
#if defined(CONFIG_SYS_CLOCK_EXISTS) && !defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
167+
#ifdef CONFIG_SYS_CLOCK_EXISTS
168168

169169
#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME) || \
170170
(MSEC_PER_SEC % CONFIG_SYS_CLOCK_TICKS_PER_SEC) || \

kernel/Kconfig

-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,6 @@ config SYS_CLOCK_TICKS_PER_SEC
799799

800800
config SYS_CLOCK_HW_CYCLES_PER_SEC
801801
int "System clock's h/w timer frequency"
802-
depends on !TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
803802
help
804803
This option specifies the frequency of the hardware timer used for the
805804
system clock (in Hz). This option is set by the SOC's or board's Kconfig file

kernel/timeout.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ static struct k_spinlock timeout_lock;
2525
static int announce_remaining;
2626

2727
#if defined(CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME)
28-
int z_clock_hw_cycles_per_sec;
28+
int z_clock_hw_cycles_per_sec = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
2929

3030
#ifdef CONFIG_USERSPACE
3131
static inline int z_vrfy_sys_clock_hw_cycles_per_sec_runtime_get(void)

0 commit comments

Comments
 (0)