This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit b11c31ba8a39263714a230612fc7d6930a0bab9e
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Jul 26 17:24:57 2026 +0200

    arch/x86_64: make ARCH_INTEL64_HPET_ALARM buildable.
    
    ARCH_INTEL64_HPET_ALARM is one of the three members of the "System Timer
    Source" choice, but selecting it does not build.  Taking qemu-intel64:nsh on
    master and moving the choice off ARCH_INTEL64_TSC_DEADLINE onto it:
    
      intel64/intel64_hpet_alarm.c:41:24: error:
          'CONFIG_ARCH_INTEL64_HPET_ALARM_CHAN' undeclared
    
    ARCH_INTEL64_HPET_ALARM_CHAN lives inside "if INTEL64_HPET" and nothing
    selects INTEL64_HPET.  Enabling that by hand moves the failure to link time,
    because intel64_oneshot_lower.c is built only when INTEL64_ONESHOT is set:
    
      undefined reference to `oneshot_initialize'
    
    Enabling INTEL64_ONESHOT as well finally reaches the real problem.
    intel64_oneshot_lower.c implements the counter flavour of struct
    oneshot_operations_s, which exists only with ONESHOT_COUNT:
    
      intel64_oneshot_lower.c: error: 'const struct oneshot_operations_s' has no
          member named 'start_absolute'
      intel64_oneshot_lower.c: error: implicit declaration of function
          'oneshot_count_init'
      intel64_oneshot_lower.c: error: initialization of
          'int (*)(struct oneshot_lowerhalf_s *, const struct timespec *)' from
          incompatible pointer type ... (four more of these)
    
    ONESHOT, ONESHOT_COUNT and ONESHOT_FAST_DIVISION were selected by
    ARCH_INTEL64_TSC_DEADLINE and by nothing else, so the other members of the
    same choice could never be built.
    
    Select the four from ARCH_INTEL64_HPET_ALARM as well.  INTEL64_ONESHOT
    selects INTEL64_HPET in turn, which is what brings
    ARCH_INTEL64_HPET_ALARM_CHAN into existence, so one added select closes all
    three stages.
    
    Impact: build only, and only for a configuration that could not be built
    before.  No existing defconfig selects ARCH_INTEL64_HPET_ALARM.
    
    Assisted-by: Claude:claude-opus-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 arch/x86_64/src/intel64/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86_64/src/intel64/Kconfig b/arch/x86_64/src/intel64/Kconfig
index 0a5af973189..d79f4112b7b 100644
--- a/arch/x86_64/src/intel64/Kconfig
+++ b/arch/x86_64/src/intel64/Kconfig
@@ -70,6 +70,10 @@ config ARCH_INTEL64_TSC
 
 config ARCH_INTEL64_HPET_ALARM
        bool "HPET timer alarm support"
+       select INTEL64_ONESHOT
+       select ONESHOT
+       select ONESHOT_COUNT
+       select ONESHOT_FAST_DIVISION
        select ALARM_ARCH
        ---help---
                With this option you can enable ALARM_ARCH features that works 
on top of

Reply via email to