Displaying 4 results from an estimated 4 matches for "set_cyc_scales".
2007 Apr 18
0
[RFC, PATCH 22/24] i386 Consolidate redundant timer code
....6.16-rc6.orig/arch/i386/kernel/timers/common.c 2006-01-02 19:21:10.000000000 -0800
+++ linux-2.6.16-rc6/arch/i386/kernel/timers/common.c 2006-03-12 19:57:42.000000000 -0800
@@ -14,6 +14,15 @@
#include "mach_timer.h"
+unsigned long cyc2ns_scale;
+unsigned long cyc2us_scale;
+
+void set_cyc_scales(unsigned long cpu_mhz)
+{
+ cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;
+ cyc2us_scale = (1 << CYC2US_SCALE_FACTOR)/cpu_mhz;
+}
+
/* ------ Calibrate the TSC -------
* Return 2^32 * (1 / (TSC clocks per usec)) for do_fast_gettimeoffset().
* Too much 64-bit arithmetic here...
2007 Apr 18
0
[RFC, PATCH 22/24] i386 Consolidate redundant timer code
....6.16-rc6.orig/arch/i386/kernel/timers/common.c 2006-01-02 19:21:10.000000000 -0800
+++ linux-2.6.16-rc6/arch/i386/kernel/timers/common.c 2006-03-12 19:57:42.000000000 -0800
@@ -14,6 +14,15 @@
#include "mach_timer.h"
+unsigned long cyc2ns_scale;
+unsigned long cyc2us_scale;
+
+void set_cyc_scales(unsigned long cpu_mhz)
+{
+ cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz;
+ cyc2us_scale = (1 << CYC2US_SCALE_FACTOR)/cpu_mhz;
+}
+
/* ------ Calibrate the TSC -------
* Return 2^32 * (1 / (TSC clocks per usec)) for do_fast_gettimeoffset().
* Too much 64-bit arithmetic here...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...id)do_div(cycles_per_jiffy, HZ);
+ cycles_per_alarm = cycles_per_sec;
+ (void)do_div(cycles_per_alarm, alarm_hz);
+ cycles_per_usec = cycles_per_sec;
+ (void)do_div(cycles_per_usec, 1000000);
+ cycles_per_msec = cycles_per_sec;
+ (void)do_div(cycles_per_msec, 1000);
+ cpu_khz = cycles_per_msec;
+
+ set_cyc_scales((unsigned long)cycles_per_usec);
+
+ printk(KERN_WARNING "VMI Timer cycles/sec = %llu ; cycles/jiffy = %llu ;"
+ "cycles/alarm = %llu", cycles_per_sec, cycles_per_jiffy, cycles_per_alarm);
+
+ /* Disable PIT. */
+ outb_p(0x3a, PIT_MODE); /* binary, mode 5, LSB/MSB, ch...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...id)do_div(cycles_per_jiffy, HZ);
+ cycles_per_alarm = cycles_per_sec;
+ (void)do_div(cycles_per_alarm, alarm_hz);
+ cycles_per_usec = cycles_per_sec;
+ (void)do_div(cycles_per_usec, 1000000);
+ cycles_per_msec = cycles_per_sec;
+ (void)do_div(cycles_per_msec, 1000);
+ cpu_khz = cycles_per_msec;
+
+ set_cyc_scales((unsigned long)cycles_per_usec);
+
+ printk(KERN_WARNING "VMI Timer cycles/sec = %llu ; cycles/jiffy = %llu ;"
+ "cycles/alarm = %llu", cycles_per_sec, cycles_per_jiffy, cycles_per_alarm);
+
+ /* Disable PIT. */
+ outb_p(0x3a, PIT_MODE); /* binary, mode 5, LSB/MSB, ch...