direct-io.hg

changeset 5901:80fed4ff19b2

Nicer platform timer string (include clock rate in mhz).
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jul 28 10:20:08 2005 +0000 (2005-07-28)
parents 1db202550e82
children 501a70f3ae96
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Thu Jul 28 09:37:53 2005 +0000
     1.2 +++ b/xen/arch/x86/time.c	Thu Jul 28 10:20:08 2005 +0000
     1.3 @@ -233,6 +233,16 @@ void calibrate_tsc_ap(void)
     1.4      atomic_dec(&tsc_calibrate_gang);
     1.5  }
     1.6  
     1.7 +static char *freq_string(u64 freq)
     1.8 +{
     1.9 +    static char s[20];
    1.10 +    unsigned int x, y;
    1.11 +    y = (unsigned int)do_div(freq, 1000000) / 1000;
    1.12 +    x = (unsigned int)freq;
    1.13 +    sprintf(s, "%u.%03uMHz", x, y);
    1.14 +    return s;
    1.15 +}
    1.16 +
    1.17  /************************************************************
    1.18   * PLATFORM TIMER 1: PROGRAMMABLE INTERVAL TIMER (LEGACY PIT)
    1.19   */
    1.20 @@ -279,7 +289,7 @@ static int init_pit(void)
    1.21      platform_timer_stamp = pit_counter64;
    1.22      set_time_scale(&platform_timer_scale, CLOCK_TICK_RATE);
    1.23  
    1.24 -    printk("Platform timer is PIT\n");
    1.25 +    printk("Platform timer is %s PIT\n", freq_string(CLOCK_TICK_RATE));
    1.26  
    1.27      return 1;
    1.28  }
    1.29 @@ -383,7 +393,7 @@ static int init_hpet(void)
    1.30      hpet_overflow(NULL);
    1.31      platform_timer_stamp = hpet_counter64;
    1.32  
    1.33 -    printk("Platform timer is HPET\n");
    1.34 +    printk("Platform timer is %s HPET\n", freq_string(hpet_rate));
    1.35  
    1.36      return 1;
    1.37  }
    1.38 @@ -464,7 +474,8 @@ static int init_cyclone(void)
    1.39      platform_timer_stamp = cyclone_counter64;
    1.40      set_time_scale(&platform_timer_scale, CYCLONE_TIMER_FREQ);
    1.41  
    1.42 -    printk("Platform timer is IBM Cyclone\n");
    1.43 +    printk("Platform timer is %s IBM Cyclone\n",
    1.44 +           freq_string(CYCLONE_TIMER_FREQ));
    1.45  
    1.46      return 1;
    1.47  }