]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/x86/kernel/tsc.c
x86: spinlock use LOCK_PREFIX
[mv-sheeva.git] / arch / x86 / kernel / tsc.c
index 94c16bdd5696aefe8d436245073b9f3bcf80032d..7603c0553909efa29718b6857cda56ba2469cd4f 100644 (file)
@@ -123,9 +123,9 @@ static u64 __init tsc_read_refs(u64 *pm, u64 *hpet)
 }
 
 /**
- * tsc_calibrate - calibrate the tsc on boot
+ * native_calibrate_tsc - calibrate the tsc on boot
  */
-static unsigned int __init tsc_calibrate(void)
+unsigned long native_calibrate_tsc(void)
 {
        unsigned long flags;
        u64 tsc1, tsc2, tr1, tr2, delta, pm1, pm2, hpet1, hpet2;
@@ -195,10 +195,6 @@ out:
        return tsc_khz_val;
 }
 
-unsigned long native_calculate_cpu_khz(void)
-{
-       return tsc_calibrate();
-}
 
 #ifdef CONFIG_X86_32
 /* Only called from the Powernow K7 cpu freq driver */
@@ -208,8 +204,8 @@ int recalibrate_cpu_khz(void)
        unsigned long cpu_khz_old = cpu_khz;
 
        if (cpu_has_tsc) {
-               cpu_khz = calculate_cpu_khz();
-               tsc_khz = cpu_khz;
+               tsc_khz = calibrate_tsc();
+               cpu_khz = tsc_khz;
                cpu_data(0).loops_per_jiffy =
                        cpufreq_scale(cpu_data(0).loops_per_jiffy,
                                        cpu_khz_old, cpu_khz);
@@ -362,6 +358,7 @@ static cycle_t read_tsc(void)
                ret : clocksource_tsc.cycle_last;
 }
 
+#ifdef CONFIG_X86_64
 static cycle_t __vsyscall_fn vread_tsc(void)
 {
        cycle_t ret = (cycle_t)vget_cycles();
@@ -369,6 +366,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
        return ret >= __vsyscall_gtod_data.clock.cycle_last ?
                ret : __vsyscall_gtod_data.clock.cycle_last;
 }
+#endif
 
 static struct clocksource clocksource_tsc = {
        .name                   = "tsc",
@@ -487,10 +485,10 @@ void __init tsc_init(void)
        if (!cpu_has_tsc)
                return;
 
-       cpu_khz = calculate_cpu_khz();
-       tsc_khz = cpu_khz;
+       tsc_khz = calibrate_tsc();
+       cpu_khz = tsc_khz;
 
-       if (!cpu_khz) {
+       if (!tsc_khz) {
                mark_tsc_unstable("could not calculate TSC khz");
                return;
        }