Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource: Change __ARCH_HAS_CLOCKSOURCE_DATA to a CONFIG option

The machinery for __ARCH_HAS_CLOCKSOURCE_DATA assumed a file in
asm-generic would be the default for architectures without their own
file in asm/, but that is not how it works.

Replace it with a Kconfig option instead.

Link: http://lkml.kernel.org/r/4E288AA6.7090804@zytor.com
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Andy Lutomirski <luto@mit.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Tony Luck <tony.luck@intel.com>

+10 -9
+3
arch/ia64/Kconfig
··· 101 101 bool 102 102 default y 103 103 104 + config ARCH_CLOCKSOURCE_DATA 105 + def_bool y 106 + 104 107 config SCHED_OMIT_FRAME_POINTER 105 108 bool 106 109 default y
-2
arch/ia64/include/asm/clocksource.h
··· 3 3 #ifndef _ASM_IA64_CLOCKSOURCE_H 4 4 #define _ASM_IA64_CLOCKSOURCE_H 5 5 6 - #define __ARCH_HAS_CLOCKSOURCE_DATA 7 - 8 6 struct arch_clocksource_data { 9 7 void *fsys_mmio; /* used by fsyscall asm code */ 10 8 };
+4
arch/x86/Kconfig
··· 93 93 config GENERIC_CLOCKEVENTS 94 94 def_bool y 95 95 96 + config ARCH_CLOCKSOURCE_DATA 97 + def_bool y 98 + depends on X86_64 99 + 96 100 config GENERIC_CLOCKEVENTS_BROADCAST 97 101 def_bool y 98 102 depends on X86_64 || (X86_32 && X86_LOCAL_APIC)
-2
arch/x86/include/asm/clocksource.h
··· 5 5 6 6 #ifdef CONFIG_X86_64 7 7 8 - #define __ARCH_HAS_CLOCKSOURCE_DATA 9 - 10 8 #define VCLOCK_NONE 0 /* No vDSO clock available. */ 11 9 #define VCLOCK_TSC 1 /* vDSO should use vread_tsc. */ 12 10 #define VCLOCK_HPET 2 /* vDSO should use vread_hpet. */
-4
include/asm-generic/clocksource.h
··· 1 - /* 2 - * Architectures should override this file to add private userspace 3 - * clock magic if needed. 4 - */
+3 -1
include/linux/clocksource.h
··· 22 22 typedef u64 cycle_t; 23 23 struct clocksource; 24 24 25 + #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA 25 26 #include <asm/clocksource.h> 27 + #endif 26 28 27 29 /** 28 30 * struct cyclecounter - hardware abstraction for a free running counter ··· 173 171 u32 shift; 174 172 u64 max_idle_ns; 175 173 176 - #ifdef __ARCH_HAS_CLOCKSOURCE_DATA 174 + #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA 177 175 struct arch_clocksource_data archdata; 178 176 #endif 179 177