Commit c8230105 authored by Andrew Morton's avatar Andrew Morton Committed by Vojtech Pavlik

[PATCH] ia32 TSC timer cleanup

Patch from: john stultz <johnstul@us.ibm.com>

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.
parent 93488c9b
...@@ -182,8 +182,6 @@ static unsigned long long tsc_values[NR_CPUS]; ...@@ -182,8 +182,6 @@ static unsigned long long tsc_values[NR_CPUS];
#define NR_LOOPS 5 #define NR_LOOPS 5
extern unsigned long fast_gettimeoffset_quotient;
/* /*
* accurate 64-bit/32-bit division, expanded to 32-bit divisions and 64-bit * 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 * multiplication. Not terribly optimized but we need it at boot time only
...@@ -223,7 +221,8 @@ static void __init synchronize_tsc_bp (void) ...@@ -223,7 +221,8 @@ static void __init synchronize_tsc_bp (void)
printk("checking TSC synchronization across %u CPUs: ", num_booting_cpus()); 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); atomic_set(&tsc_start_flag, 1);
wmb(); wmb();
......
...@@ -29,7 +29,7 @@ static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ ...@@ -29,7 +29,7 @@ static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */
* Equal to 2^32 * (1 / (clocks per usec) ). * Equal to 2^32 * (1 / (clocks per usec) ).
* Initialized in time_init. * Initialized in time_init.
*/ */
unsigned long fast_gettimeoffset_quotient; static unsigned long fast_gettimeoffset_quotient;
static unsigned long get_offset_tsc(void) static unsigned long get_offset_tsc(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment