diff --git a/include/kernel.h b/include/kernel.h index 2d912497e4f..5cc05767ae1 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -1684,8 +1684,7 @@ static inline void *z_impl_k_timer_user_data_get(struct k_timer *timer) * @rst * While this function returns time in milliseconds, it does * not mean it has millisecond resolution. The actual resolution depends on - * :option:`CONFIG_SYS_CLOCK_TICKS_PER_SEC` config option, and with the - * default setting of 100, system time is updated in increments of 10ms. + * :option:`CONFIG_SYS_CLOCK_TICKS_PER_SEC` config option. * @endrst * * @return Current uptime in milliseconds. @@ -1741,8 +1740,7 @@ __deprecated static inline void k_disable_sys_clock_always_on(void) * @rst * While this function returns time in milliseconds, it does * not mean it has millisecond resolution. The actual resolution depends on - * :option:`CONFIG_SYS_CLOCK_TICKS_PER_SEC` config option, and with the - * default setting of 100, system time is updated in increments of 10ms. + * :option:`CONFIG_SYS_CLOCK_TICKS_PER_SEC` config option * @endrst * * @return Current uptime in milliseconds. diff --git a/kernel/Kconfig b/kernel/Kconfig index f161fd693af..609e6b343fe 100644 --- a/kernel/Kconfig +++ b/kernel/Kconfig @@ -529,9 +529,11 @@ config ARCH_HAS_CUSTOM_BUSY_WAIT config SYS_CLOCK_TICKS_PER_SEC int "System tick frequency (in ticks/second)" + default 100 if QEMU_TARGET || SOC_POSIX + default 10000 if TICKLESS_CAPABLE default 100 help - This option specifies the frequency of the system clock in Hz. + This option specifies the nominal frequency of the system clock in Hz. Depending on the choice made, an amount of possibly expensive math must occur when converting ticks to milliseconds and vice-versa. Some values @@ -567,10 +569,13 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC and the user should generally avoid modifying it via the menu configuration. config SYS_CLOCK_EXISTS - def_bool (SYS_CLOCK_TICKS_PER_SEC != 0) - # omit prompt to signify a "hidden" option + bool "System clock exists and is enabled" + default y help This option specifies that the kernel lacks timer support. + Some device configurations can eliminate significant code if + this is disabled. Obviously timeout-related APIs will not + work. config XIP bool "Execute in place" diff --git a/samples/basic/minimal/no-timers.conf b/samples/basic/minimal/no-timers.conf index 05dc0d53afd..961178ee05c 100644 --- a/samples/basic/minimal/no-timers.conf +++ b/samples/basic/minimal/no-timers.conf @@ -1,3 +1,2 @@ # No timer support in the kernel - -CONFIG_SYS_CLOCK_TICKS_PER_SEC=0 +CONFIG_SYS_CLOCK_EXISTS=n