Date: Sat, 25 Jun 2011 16:35:44 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r223542 - head/sys/ia64/ia64 Message-ID: <201106251635.p5PGZife014617@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106251635.p5PGZife014617>