diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2013-02-10 01:13:56 +0000 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-02-12 21:14:31 -0500 |
commit | 473013a8219176a39cbdabb5caabaf341d8ce44b (patch) | |
tree | c85541e1c1373c5d5e6740412f22b710b681ba52 | |
parent | 38c2ebf41da37e3a4f452492e005c75b8d0c3ab1 (diff) | |
download | seabios-473013a8219176a39cbdabb5caabaf341d8ce44b.tar.gz |
Don't calibrate TSC if PMTIMER is already set up
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | src/clock.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/clock.c b/src/clock.c index bbcafd7..708d413 100644 --- a/src/clock.c +++ b/src/clock.c @@ -65,10 +65,20 @@ 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) |