]> xenbits.xensource.com Git - seabios.git/commitdiff
Don't calibrate TSC if PMTIMER is already set up
authorDavid Woodhouse <David.Woodhouse@intel.com>
Sun, 10 Feb 2013 01:13:56 +0000 (01:13 +0000)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 13 Feb 2013 02:14:31 +0000 (21:14 -0500)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
src/clock.c

index bbcafd79b5eaad26fb5ace09d6c8b8b7d577edec..708d413f2d8698d630cb564454dea64524fa9bc4 100644 (file)
 u32 cpu_khz VAR16VISIBLE;
 u8 no_tsc VAR16VISIBLE;
 
+u16 pmtimer_ioport VAR16VISIBLE;
+u32 pmtimer_wraps VARLOW;
+u32 pmtimer_last VARLOW;
+
 static void
 calibrate_tsc(void)
 {
     u32 eax, ebx, ecx, edx, cpuid_features = 0;
+
+    if (CONFIG_PMTIMER && GET_GLOBAL(pmtimer_ioport)) {
+        dprintf(3, "pmtimer already configured; will not calibrate TSC\n");
+        return;
+    }
+
     cpuid(0, &eax, &ebx, &ecx, &edx);
     if (eax > 0)
         cpuid(1, &eax, &ebx, &ecx, &cpuid_features);
@@ -129,10 +139,6 @@ emulate_tsc(void)
     return ret;
 }
 
-u16 pmtimer_ioport VAR16VISIBLE;
-u32 pmtimer_wraps VARLOW;
-u32 pmtimer_last VARLOW;
-
 void pmtimer_setup(u16 ioport, u32 khz)
 {
     if (!CONFIG_PMTIMER)