This is an automated email from the ASF dual-hosted git repository. GUIDINGLI pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 45720241219fba32a7ce1f0a06292f2ed8ab142c Author: Marco Casaroli <[email protected]> AuthorDate: Tue Nov 17 12:35:55 2026 +0100 arch/x86_64/intel64: Require a TSC timer for CONFIG_RTC_HIRES. The high resolution RTC reads the TSC and divides it by g_x86_64_timer_freq / 1000000. Only the TSC system timers (ARCH_INTEL64_TSC_DEADLINE and ARCH_INTEL64_TSC) set g_x86_64_timer_freq. With ARCH_INTEL64_HPET_ALARM it stays 0, so the first up_rtc_gettime() call (clock_initialize() -> clock_inittime()) divides by zero. The divide error handler returns to the same instruction, so the boot stops before the console prints anything, under QEMU TCG and KVM. Stop the build with an error for this configuration. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- arch/x86_64/src/intel64/intel64_rtc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86_64/src/intel64/intel64_rtc.c b/arch/x86_64/src/intel64/intel64_rtc.c index 86a08103596..8d01d648a9e 100644 --- a/arch/x86_64/src/intel64/intel64_rtc.c +++ b/arch/x86_64/src/intel64/intel64_rtc.c @@ -51,6 +51,14 @@ # ifndef CONFIG_RTC_FREQUENCY # error "CONFIG_RTC_FREQUENCY is required for CONFIG_RTC_HIRES" # endif + +/* The RTC divides TSC cycles by the TSC frequency (g_x86_64_timer_freq). + * Only the TSC timers set it: with the HPET timer it is 0. + */ + +# ifndef CONFIG_ARCH_INTEL64_HAVE_TSC +# error "CONFIG_RTC_HIRES needs a TSC system timer" +# endif #endif #define NS_PER_USEC 1000UL
