kernel: Guard SYS_CLOCK_HW_CYCLES_PER_SEC to avoid spurious empty macro

If SYS_CLOCK_EXISTS is not enabled, then the SYS_CLOCK_HW_CYCLES_PER_SEC
still gets created, but with no value. This causes the code generation
in misc/generated/CMakeLists.txt to create an empty assembly macro:

`.equ  CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC,`

which then causes a build error.

Disable SYS_CLOCK_HW_CYCLES_PER_SEC entirely when SYS_CLOCK_EXISTS is
disabled to fix this.

This is a follow-up to 03f46db859.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2025-06-06 10:53:21 +02:00 committed by Fabio Baltieri
commit 61cdcb3383

View file

@ -844,6 +844,7 @@ config SYS_CLOCK_TICKS_PER_SEC
config SYS_CLOCK_HW_CYCLES_PER_SEC
int "System clock's h/w timer frequency"
default 0 if TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
depends on SYS_CLOCK_EXISTS
help
This option specifies the frequency of the hardware timer used for the
system clock (in Hz). This option is set by the SOC's or board's Kconfig file