mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND][PATCH] linux-2.5.60_timer-tsc-cleanups_A1
@ 2003-02-12  0:19 john stultz
  0 siblings, 0 replies; only message in thread
From: john stultz @ 2003-02-12  0:19 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: lkml, Andrew Morton

Linus, All

	This cleanup patch makes fast_gettimeoffset_quotient (a timer_tsc
specific variable) static, and replaces its usage with cpu_khz, making
it timer_opt independent.

Please apply.

thanks
-john

diff -Nru a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
--- a/arch/i386/kernel/smpboot.c	Tue Feb 11 16:12:33 2003
+++ b/arch/i386/kernel/smpboot.c	Tue Feb 11 16:12:33 2003
@@ -182,8 +182,6 @@
 
 #define NR_LOOPS 5
 
-extern unsigned long fast_gettimeoffset_quotient;
-
 /*
  * accurate 64-bit/32-bit division, expanded to 32-bit divisions and 64-bit
  * multiplication. Not terribly optimized but we need it at boot time only
@@ -223,7 +221,8 @@
 
 	printk("checking TSC synchronization across %u CPUs: ", num_booting_cpus());
 
-	one_usec = ((1<<30)/fast_gettimeoffset_quotient)*(1<<2);
+	/* convert from kcyc/sec to cyc/usec */
+	one_usec = cpu_khz / 1000;
 
 	atomic_set(&tsc_start_flag, 1);
 	wmb();
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	Tue Feb 11 16:12:33 2003
+++ b/arch/i386/kernel/timers/timer_tsc.c	Tue Feb 11 16:12:33 2003
@@ -29,7 +29,7 @@
  * Equal to 2^32 * (1 / (clocks per usec) ).
  * Initialized in time_init.
  */
-unsigned long fast_gettimeoffset_quotient;
+static unsigned long fast_gettimeoffset_quotient;
 
 static unsigned long get_offset_tsc(void)
 {




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-02-12  0:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-12  0:19 [RESEND][PATCH] linux-2.5.60_timer-tsc-cleanups_A1 john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®