# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet v2.5.53 -> 1.952 # arch/i386/kernel/timers/Makefile 1.3 -> 1.4 # include/asm-i386/processor.h 1.34 -> 1.35 # arch/i386/kernel/cpu/common.c 1.16 -> 1.17 # arch/i386/Kconfig 1.14 -> 1.15 # arch/i386/kernel/timers/timer_tsc.c 1.6 -> 1.7 # arch/i386/mach-voyager/setup.c 1.1 -> 1.2 # arch/i386/kernel/timers/timer_pit.c 1.5 -> 1.6 # arch/i386/kernel/timers/timer.c 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/12/23 torvalds@home.transmeta.com 1.951 # Linux v2.5.53 # -------------------------------------------- # 02/12/27 jejb@raven.il.steeleye.com 1.952 # Make the TSC a run-time specifier only # # Also localises the parameters and setup into kernel/timers # # Adds an external flag so that the tsc can be disabled from the # machine specific setup (used by voyager) # -------------------------------------------- # diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig --- a/arch/i386/Kconfig Sat Dec 28 17:11:18 2002 +++ b/arch/i386/Kconfig Sat Dec 28 17:11:18 2002 @@ -253,11 +253,6 @@ depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 default y -config X86_TSC - bool - depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || M686 || M586MMX || M586TSC - default y - config X86_GOOD_APIC bool depends on MK7 || MPENTIUM4 || MPENTIUMIII || M686 || M586MMX diff -Nru a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c --- a/arch/i386/kernel/cpu/common.c Sat Dec 28 17:11:18 2002 +++ b/arch/i386/kernel/cpu/common.c Sat Dec 28 17:11:18 2002 @@ -45,25 +45,6 @@ } __setup("cachesize=", cachesize_setup); -#ifndef CONFIG_X86_TSC -static int tsc_disable __initdata = 0; - -static int __init tsc_setup(char *str) -{ - tsc_disable = 1; - return 1; -} -#else -#define tsc_disable 0 - -static int __init tsc_setup(char *str) -{ - printk("notsc: Kernel compiled with CONFIG_X86_TSC, cannot disable TSC.\n"); - return 1; -} -#endif -__setup("notsc", tsc_setup); - int __init get_model_name(struct cpuinfo_x86 *c) { unsigned int *v; diff -Nru a/arch/i386/kernel/timers/Makefile b/arch/i386/kernel/timers/Makefile --- a/arch/i386/kernel/timers/Makefile Sat Dec 28 17:11:18 2002 +++ b/arch/i386/kernel/timers/Makefile Sat Dec 28 17:11:18 2002 @@ -2,8 +2,6 @@ # Makefile for x86 timers # -obj-y:= timer.o +obj-y:= timer.o timer_tsc.o timer_pit.o -obj-y += timer_tsc.o -obj-y += timer_pit.o -obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o +obj-$(CONFIG_X86_CYCLONE) += timer_cyclone.o diff -Nru a/arch/i386/kernel/timers/timer.c b/arch/i386/kernel/timers/timer.c --- a/arch/i386/kernel/timers/timer.c Sat Dec 28 17:11:18 2002 +++ b/arch/i386/kernel/timers/timer.c Sat Dec 28 17:11:18 2002 @@ -8,9 +8,7 @@ /* list of timers, ordered by preference, NULL terminated */ static struct timer_opts* timers[] = { &timer_tsc, -#ifndef CONFIG_X86_TSC &timer_pit, -#endif NULL, }; diff -Nru a/arch/i386/kernel/timers/timer_pit.c b/arch/i386/kernel/timers/timer _pit.c --- a/arch/i386/kernel/timers/timer_pit.c Sat Dec 28 17:11:18 2002 +++ b/arch/i386/kernel/timers/timer_pit.c Sat Dec 28 17:11:18 2002 @@ -9,7 +9,9 @@ #include #include #include +#include #include +#include extern spinlock_t i8259A_lock; extern spinlock_t i8253_lock; diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer _tsc.c --- a/arch/i386/kernel/timers/timer_tsc.c Sat Dec 28 17:11:18 2002 +++ b/arch/i386/kernel/timers/timer_tsc.c Sat Dec 28 17:11:18 2002 @@ -11,6 +11,10 @@ #include #include +/* processor.h for distable_tsc flag */ +#include + +int tsc_disable __initdata = 0; extern int x86_udelay_tsc; extern spinlock_t i8253_lock; @@ -286,6 +290,18 @@ } return -ENODEV; } + +/* disable flag for tsc. Takes effect by clearing the TSC cpu flag + * in cpu/common.c */ +static int __init tsc_setup(char *str) +{ + tsc_disable = 1; + return 1; +} + +__setup("notsc", tsc_setup); + + /************************************************************/ diff -Nru a/arch/i386/mach-voyager/setup.c b/arch/i386/mach-voyager/setup.c --- a/arch/i386/mach-voyager/setup.c Sat Dec 28 17:11:18 2002 +++ b/arch/i386/mach-voyager/setup.c Sat Dec 28 17:11:18 2002 @@ -29,6 +29,9 @@ void __init pre_setup_arch_hook(void) { + /* Voyagers run their CPUs from independent clocks, so disable + * the TSC code because we can't sync them */ + tsc_disable = 1; } void __init trap_init_hook(void) diff -Nru a/include/asm-i386/processor.h b/include/asm-i386/processor.h --- a/include/asm-i386/processor.h Sat Dec 28 17:11:18 2002 +++ b/include/asm-i386/processor.h Sat Dec 28 17:11:18 2002 @@ -19,6 +19,9 @@ #include #include +/* flag for disabling the tsc */ +extern int tsc_disable; + struct desc_struct { unsigned long a,b; };