From owner-svn-src-all@FreeBSD.ORG Sat Jun 25 16:35:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 562BE106567E; Sat, 25 Jun 2011 16:35:44 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 465518FC16; Sat, 25 Jun 2011 16:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PGZi7D014619; Sat, 25 Jun 2011 16:35:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5PGZife014617; Sat, 25 Jun 2011 16:35:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201106251635.p5PGZife014617@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 25 Jun 2011 16:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223542 - head/sys/ia64/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 16:35:44 -0000 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;