vserver 2.0 rc7
[linux-2.6.git] / arch / i386 / kernel / timers / timer_tsc.c
index a685994..180444d 100644 (file)
@@ -320,6 +320,26 @@ core_initcall(cpufreq_tsc);
 static inline void cpufreq_delayed_get(void) { return; }
 #endif 
 
+int recalibrate_cpu_khz(void)
+{
+#ifndef CONFIG_SMP
+       unsigned long cpu_khz_old = cpu_khz;
+
+       if (cpu_has_tsc) {
+               init_cpu_khz();
+               cpu_data[0].loops_per_jiffy =
+                   cpufreq_scale(cpu_data[0].loops_per_jiffy,
+                                 cpu_khz_old,
+                                 cpu_khz);
+               return 0;
+       } else
+               return -ENODEV;
+#else
+       return -ENODEV;
+#endif
+}
+EXPORT_SYMBOL(recalibrate_cpu_khz);
+
 static void mark_offset_tsc(void)
 {
        unsigned long lost,delay;
@@ -477,7 +497,7 @@ static int __init init_tsc(char* override)
        if (cpu_has_tsc) {
                unsigned long tsc_quotient;
 #ifdef CONFIG_HPET_TIMER
-               if (is_hpet_enabled()){
+               if (is_hpet_enabled() && hpet_use_timer) {
                        unsigned long result, remain;
                        printk("Using TSC for gettimeofday\n");
                        tsc_quotient = calibrate_tsc_hpet(NULL);