[PATCH v4 2/7] vDSO: Make clockmode constants available without CONFIG_GENERIC_GETTIMEOFDAY
Thomas Weißschuh <[email protected]> Fri, 24 Jul 2026 15:36:19 +0200
| Newsgroups | org.kernel.vger.linux-mips,dev.linux.lists.loongarch,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-riscv,org.kernel.vger.linux-arch,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
Some code, for example clocksource drivers, may want to use the vDSO clockmode constants even when CONFIG_GENERIC_GETTIMEOFDAY=n. But the symbols are completely hidden in that case, making ugly ifdeffery necessary. Always provide the enum definitions. As not all architectures provide asm/vdso/clocksource.h, provide an empty stub in asm-generic for it. Signed-off-by: Thomas Weißschuh <[email protected]> --- include/asm-generic/Kbuild | 1 + include/asm-generic/vdso/clocksource.h | 0 include/vdso/clocksource.h | 4 +--- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild index 15df9dcb42a5..2bc00c67dc54 100644 --- a/include/asm-generic/Kbuild +++ b/include/asm-generic/Kbuild @@ -62,6 +62,7 @@ mandatory-y += topology.h mandatory-y += trace_clock.h mandatory-y += uaccess.h mandatory-y += unwind_user.h +mandatory-y += vdso/clocksource.h mandatory-y += vermagic.h mandatory-y += vga.h mandatory-y += video.h diff --git a/include/asm-generic/vdso/clocksource.h b/include/asm-generic/vdso/clocksource.h new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/include/vdso/clocksource.h b/include/vdso/clocksource.h index c682e7c60273..bce81c02a7c6 100644 --- a/include/vdso/clocksource.h +++ b/include/vdso/clocksource.h @@ -4,13 +4,11 @@ #include <vdso/limits.h> -#ifdef CONFIG_GENERIC_GETTIMEOFDAY #include <asm/vdso/clocksource.h> -#endif /* CONFIG_GENERIC_GETTIMEOFDAY */ enum vdso_clock_mode { VDSO_CLOCKMODE_NONE, -#ifdef CONFIG_GENERIC_GETTIMEOFDAY +#ifdef VDSO_ARCH_CLOCKMODES VDSO_ARCH_CLOCKMODES, #endif VDSO_CLOCKMODE_MAX, -- 2.55.0