direct-io.hg
changeset 5603:41a5181f74df
bitkeeper revision 1.1769 (42c2cac1Ua7yeT9FnpvjJNvdSrd3BA)
Remove ticks_per_usec global variable. cpu_khz suffices.
Signed-off-by: Keir Fraser <keir@xensource.com>
Remove ticks_per_usec global variable. cpu_khz suffices.
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Wed Jun 29 16:22:25 2005 +0000 (2005-06-29) |
parents | 0b5fab43ff59 |
children | f66a730a2c3d |
files | xen/arch/x86/delay.c xen/arch/x86/time.c xen/include/asm-x86/delay.h |
line diff
1.1 --- a/xen/arch/x86/delay.c Tue Jun 28 17:47:14 2005 +0000 1.2 +++ b/xen/arch/x86/delay.c Wed Jun 29 16:22:25 2005 +0000 1.3 @@ -12,12 +12,13 @@ 1.4 1.5 #include <xen/config.h> 1.6 #include <xen/delay.h> 1.7 +#include <xen/time.h> 1.8 #include <asm/msr.h> 1.9 #include <asm/processor.h> 1.10 1.11 void __udelay(unsigned long usecs) 1.12 { 1.13 - unsigned long ticks = usecs * ticks_per_usec; 1.14 + unsigned long ticks = usecs * (cpu_khz / 1000); 1.15 unsigned long s, e; 1.16 1.17 rdtscl(s);
2.1 --- a/xen/arch/x86/time.c Tue Jun 28 17:47:14 2005 +0000 2.2 +++ b/xen/arch/x86/time.c Wed Jun 29 16:22:25 2005 +0000 2.3 @@ -33,8 +33,7 @@ 2.4 #include <asm/mc146818rtc.h> 2.5 2.6 /* GLOBAL */ 2.7 -unsigned long cpu_khz; /* Detected as we calibrate the TSC */ 2.8 -unsigned long ticks_per_usec; /* TSC ticks per microsecond. */ 2.9 +unsigned long cpu_khz; /* CPU clock frequency in kHz. */ 2.10 spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; 2.11 int timer_ack = 0; 2.12 unsigned long volatile jiffies; 2.13 @@ -375,7 +374,6 @@ void __init time_init(void) 2.14 if ( !ticks_per_frac ) 2.15 panic("Error calibrating TSC\n"); 2.16 2.17 - ticks_per_usec = ticks_per_frac / (1000000/CALIBRATE_FRAC); 2.18 cpu_khz = ticks_per_frac / (1000/CALIBRATE_FRAC); 2.19 2.20 cpu_freq = (u64)ticks_per_frac * (u64)CALIBRATE_FRAC;
3.1 --- a/xen/include/asm-x86/delay.h Tue Jun 28 17:47:14 2005 +0000 3.2 +++ b/xen/include/asm-x86/delay.h Wed Jun 29 16:22:25 2005 +0000 3.3 @@ -7,7 +7,6 @@ 3.4 * Delay routines calling functions in arch/i386/lib/delay.c 3.5 */ 3.6 3.7 -extern unsigned long ticks_per_usec; 3.8 extern void __udelay(unsigned long usecs); 3.9 #define udelay(n) __udelay(n) 3.10