From f14c693e10ec6ce1ff29b36de934f6a32242bfef Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 1 Apr 2011 00:24:03 -0700 Subject: [PATCH] fix bug in the routine, which calculates the apic timer frequecy --- arch/x86/kernel/apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index f999e110..e134483b 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c @@ -310,10 +310,10 @@ int apic_calibration(void) /* wait 3 time slices to determine a ICR */ start = rdtsc(); do { - //flush_pipeline(); + flush_pipeline(); end = rdtsc(); ticks = end > start ? end - start : start - end; - } while(ticks < 3*RC_REFCLOCKMHZ / TIMER_FREQ); + } while(ticks*TIMER_FREQ < 3*RC_REFCLOCKMHZ*1000000); diff = 0xFFFFFFFF - lapic_read(APIC_CCR);