ia64/xen-unstable

changeset 18118:978ffdd19c0f

x86: More accurate PIT frequency estimation (1193182Hz)

In practice this has no impact since variance between crystals will be
substantially greater than 1-2ppm. But we may as well be as accurate
as possible.

From: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Jul 21 09:46:17 2008 +0100 (2008-07-21)
parents 217c8b6ebfab
children 34ad9e2c0d10
files xen/arch/x86/i8259.c xen/arch/x86/time.c xen/include/asm-x86/hvm/vpt.h
line diff
     1.1 --- a/xen/arch/x86/i8259.c	Mon Jul 21 09:42:30 2008 +0100
     1.2 +++ b/xen/arch/x86/i8259.c	Mon Jul 21 09:46:17 2008 +0100
     1.3 @@ -411,7 +411,7 @@ void __init init_IRQ(void)
     1.4      apic_intr_init();
     1.5  
     1.6      /* Set the clock to HZ Hz */
     1.7 -#define CLOCK_TICK_RATE 1193180 /* crystal freq (Hz) */
     1.8 +#define CLOCK_TICK_RATE 1193182 /* crystal freq (Hz) */
     1.9  #define LATCH (((CLOCK_TICK_RATE)+(HZ/2))/HZ)
    1.10      outb_p(0x34, PIT_MODE);        /* binary, mode 2, LSB/MSB, ch 0 */
    1.11      outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
     2.1 --- a/xen/arch/x86/time.c	Mon Jul 21 09:42:30 2008 +0100
     2.2 +++ b/xen/arch/x86/time.c	Mon Jul 21 09:46:17 2008 +0100
     2.3 @@ -214,7 +214,7 @@ static struct irqaction irq0 = { timer_i
     2.4   * Return processor ticks per second / CALIBRATE_FRAC.
     2.5   */
     2.6  
     2.7 -#define CLOCK_TICK_RATE 1193180 /* system crystal frequency (Hz) */
     2.8 +#define CLOCK_TICK_RATE 1193182 /* system crystal frequency (Hz) */
     2.9  #define CALIBRATE_FRAC  20      /* calibrate over 50ms */
    2.10  #define CALIBRATE_LATCH ((CLOCK_TICK_RATE+(CALIBRATE_FRAC/2))/CALIBRATE_FRAC)
    2.11  
     3.1 --- a/xen/include/asm-x86/hvm/vpt.h	Mon Jul 21 09:42:30 2008 +0100
     3.2 +++ b/xen/include/asm-x86/hvm/vpt.h	Mon Jul 21 09:46:17 2008 +0100
     3.3 @@ -95,7 +95,7 @@ struct periodic_time {
     3.4  };
     3.5  
     3.6  
     3.7 -#define PIT_FREQ 1193181
     3.8 +#define PIT_FREQ 1193182
     3.9  #define PIT_BASE 0x40
    3.10  
    3.11  typedef struct PITState {