WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Remove ticks_per_usec global variable. cpu_khz suffices.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 29 Jun 2005 16:22:25 +0000
Cc: james@xxxxxxxxxxxxx
Delivery-date: Wed, 29 Jun 2005 17:01:48 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Remove ticks_per_usec global variable. cpu_khz suffices., BitKeeper Bot <=