svn commit: r223542 - head/sys/ia64/ia64
Marcel Moolenaar
marcel at FreeBSD.org
Sat Jun 25 16:35:44 UTC 2011
Author: marcel
Date: Sat Jun 25 16:35:43 2011
New Revision: 223542
URL: http://svn.freebsd.org/changeset/base/223542
Log:
Define the minimum fractional period in terms of hz. We know hz is
a magnitude smaller than itc_freq. A minimum period of 10*hz is
sufficient precision. As a side-effect, the number of clocks per
second, when the machine is idle, dropped by more than 50%.
Be anal and define the maximum period to be at least 4G seconds.
With a 64-bit counter and an ITC frequency that's expected to be
always less than 4Ghz, it takes longer than that to wrap around.
Modified:
head/sys/ia64/ia64/clock.c
Modified: head/sys/ia64/ia64/clock.c
==============================================================================
--- head/sys/ia64/ia64/clock.c Sat Jun 25 16:27:49 2011 (r223541)
+++ head/sys/ia64/ia64/clock.c Sat Jun 25 16:35:43 2011 (r223542)
@@ -184,8 +184,8 @@ clock_configure(void *dummy)
et->et_quality = 1000;
et->et_frequency = itc_freq;
et->et_min_period.sec = 0;
- et->et_min_period.frac = ((1ul << 32) / itc_freq) << 32;
- et->et_max_period.sec = 0xfffffff0 / itc_freq;
+ et->et_min_period.frac = (0x8000000000000000ul / (u_long)(10*hz)) << 1;
+ et->et_max_period.sec = ~0ul; /* XXX unless itc_freq >= (1<<32) */
et->et_max_period.frac = ((0xfffffffeul << 32) / itc_freq) << 32;
et->et_start = ia64_clock_start;
et->et_stop = ia64_clock_stop;
More information about the svn-src-all
mailing list