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] Nicer platform timer string (include clock rate in mhz).

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Nicer platform timer string (include clock rate in mhz).
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 28 Jul 2005 06:20:10 -0400
Delivery-date: Thu, 28 Jul 2005 10:20:35 +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-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 80fed4ff19b2423feb98ceddf5cf98218836699d
# Parent  1db202550e822de70c708ffdd122a9bfded58d46
Nicer platform timer string (include clock rate in mhz).
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 1db202550e82 -r 80fed4ff19b2 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Thu Jul 28 09:37:53 2005
+++ b/xen/arch/x86/time.c       Thu Jul 28 10:20:08 2005
@@ -233,6 +233,16 @@
     atomic_dec(&tsc_calibrate_gang);
 }
 
+static char *freq_string(u64 freq)
+{
+    static char s[20];
+    unsigned int x, y;
+    y = (unsigned int)do_div(freq, 1000000) / 1000;
+    x = (unsigned int)freq;
+    sprintf(s, "%u.%03uMHz", x, y);
+    return s;
+}
+
 /************************************************************
  * PLATFORM TIMER 1: PROGRAMMABLE INTERVAL TIMER (LEGACY PIT)
  */
@@ -279,7 +289,7 @@
     platform_timer_stamp = pit_counter64;
     set_time_scale(&platform_timer_scale, CLOCK_TICK_RATE);
 
-    printk("Platform timer is PIT\n");
+    printk("Platform timer is %s PIT\n", freq_string(CLOCK_TICK_RATE));
 
     return 1;
 }
@@ -383,7 +393,7 @@
     hpet_overflow(NULL);
     platform_timer_stamp = hpet_counter64;
 
-    printk("Platform timer is HPET\n");
+    printk("Platform timer is %s HPET\n", freq_string(hpet_rate));
 
     return 1;
 }
@@ -464,7 +474,8 @@
     platform_timer_stamp = cyclone_counter64;
     set_time_scale(&platform_timer_scale, CYCLONE_TIMER_FREQ);
 
-    printk("Platform timer is IBM Cyclone\n");
+    printk("Platform timer is %s IBM Cyclone\n",
+           freq_string(CYCLONE_TIMER_FREQ));
 
     return 1;
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Nicer platform timer string (include clock rate in mhz)., Xen patchbot -unstable <=