--- arch/i386/kernel/tsc.c | 10 ++-------- include/asm-i386/timex.h | 8 ++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) Index: linux-2.6.21-rc6/arch/i386/kernel/tsc.c =================================================================== --- linux-2.6.21-rc6.orig/arch/i386/kernel/tsc.c 2007-04-13 23:11:03.000000000 -0700 +++ linux-2.6.21-rc6/arch/i386/kernel/tsc.c 2007-04-13 23:14:05.000000000 -0700 @@ -83,19 +83,13 @@ static inline int check_tsc_unstable(voi * * -johnstul@us.ibm.com "math is hard, lets go shopping!" */ -static unsigned long cyc2ns_scale __read_mostly; - -#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ +unsigned long cyc2ns_scale __read_mostly; static inline void set_cyc2ns_scale(unsigned long cpu_khz) { cyc2ns_scale = (1000000 << CYC2NS_SCALE_FACTOR)/cpu_khz; } -static inline unsigned long long cycles_2_ns(unsigned long long cyc) -{ - return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; -} /* * Scheduler clock - returns current time in nanosec units. @@ -115,7 +109,7 @@ unsigned long long sched_clock(void) get_scheduled_cycles(this_offset); /* return the value in ns */ - return cycles_2_ns(this_offset); + return cycles_to_ns(this_offset); } unsigned long native_calculate_cpu_khz(void) Index: linux-2.6.21-rc6/include/asm-i386/timex.h =================================================================== --- linux-2.6.21-rc6.orig/include/asm-i386/timex.h 2007-04-13 23:11:03.000000000 -0700 +++ linux-2.6.21-rc6/include/asm-i386/timex.h 2007-04-13 23:14:05.000000000 -0700 @@ -19,4 +19,12 @@ extern int read_current_timer(unsigned long *timer_value); #define ARCH_HAS_READ_CURRENT_TIMER 1 +extern long cyc2ns_scale; +#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ + +static inline unsigned long long cycles_to_ns(unsigned long long cyc) +{ + return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; +} + #endif