[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove ticks_per_usec global variable. cpu_khz suffices.



ChangeSet 1.1769, 2005/06/29 17:22:25+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Remove ticks_per_usec global variable. cpu_khz suffices.
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 arch/x86/delay.c        |    3 ++-
 arch/x86/time.c         |    4 +---
 include/asm-x86/delay.h |    1 -
 3 files changed, 3 insertions(+), 5 deletions(-)


diff -Nru a/xen/arch/x86/delay.c b/xen/arch/x86/delay.c
--- a/xen/arch/x86/delay.c      2005-06-29 13:03:00 -04:00
+++ b/xen/arch/x86/delay.c      2005-06-29 13:03:00 -04:00
@@ -12,12 +12,13 @@
 
 #include <xen/config.h>
 #include <xen/delay.h>
+#include <xen/time.h>
 #include <asm/msr.h>
 #include <asm/processor.h>
 
 void __udelay(unsigned long usecs)
 {
-    unsigned long ticks = usecs * ticks_per_usec;
+    unsigned long ticks = usecs * (cpu_khz / 1000);
     unsigned long s, e;
 
     rdtscl(s);
diff -Nru a/xen/arch/x86/time.c b/xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       2005-06-29 13:03:00 -04:00
+++ b/xen/arch/x86/time.c       2005-06-29 13:03:00 -04:00
@@ -33,8 +33,7 @@
 #include <asm/mc146818rtc.h>
 
 /* GLOBAL */
-unsigned long cpu_khz;  /* Detected as we calibrate the TSC */
-unsigned long ticks_per_usec; /* TSC ticks per microsecond. */
+unsigned long cpu_khz;  /* CPU clock frequency in kHz. */
 spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
 int timer_ack = 0;
 unsigned long volatile jiffies;
@@ -375,7 +374,6 @@
     if ( !ticks_per_frac )
         panic("Error calibrating TSC\n");
 
-    ticks_per_usec = ticks_per_frac / (1000000/CALIBRATE_FRAC);
     cpu_khz = ticks_per_frac / (1000/CALIBRATE_FRAC);
 
     cpu_freq = (u64)ticks_per_frac * (u64)CALIBRATE_FRAC;
diff -Nru a/xen/include/asm-x86/delay.h b/xen/include/asm-x86/delay.h
--- a/xen/include/asm-x86/delay.h       2005-06-29 13:03:00 -04:00
+++ b/xen/include/asm-x86/delay.h       2005-06-29 13:03:00 -04:00
@@ -7,7 +7,6 @@
  * Delay routines calling functions in arch/i386/lib/delay.c
  */
 
-extern unsigned long ticks_per_usec; 
 extern void __udelay(unsigned long usecs);
 #define udelay(n) __udelay(n)
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.