summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-06-25 16:35:43 +0000
committermarcel <marcel@FreeBSD.org>2011-06-25 16:35:43 +0000
commit628e425dc7e2da9ca525a72963f7603fc2358863 (patch)
tree775deac5fbf6540cd1e441a46d2b7f8b3c7c21ba /sys/ia64
parentd717d950fa88ca5ea6d288d7a789bfd1b1709559 (diff)
downloadFreeBSD-src-628e425dc7e2da9ca525a72963f7603fc2358863.zip
FreeBSD-src-628e425dc7e2da9ca525a72963f7603fc2358863.tar.gz
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.
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/ia64/clock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ia64/ia64/clock.c b/sys/ia64/ia64/clock.c
index 881c46f..74b2248 100644
--- a/sys/ia64/ia64/clock.c
+++ b/sys/ia64/ia64/clock.c
@@ -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;
OpenPOWER on IntegriCloud