From owner-svn-src-projects@FreeBSD.ORG Thu Oct 29 05:18:03 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24AEA1065676; Thu, 29 Oct 2009 05:18:03 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1488E8FC1A; Thu, 29 Oct 2009 05:18:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9T5I2OS084738; Thu, 29 Oct 2009 05:18:02 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9T5I2rF084737; Thu, 29 Oct 2009 05:18:02 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <200910290518.n9T5I2rF084737@svn.freebsd.org> From: Neel Natu Date: Thu, 29 Oct 2009 05:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198569 - projects/mips/sys/mips/mips X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Oct 2009 05:18:03 -0000 Author: neel Date: Thu Oct 29 05:18:02 2009 New Revision: 198569 URL: http://svn.freebsd.org/changeset/base/198569 Log: Deal with overflow of the COUNT register correctly. The 'cycles_per_hz' has nothing to do with the rollover. Approved by: imp (mentor) Modified: projects/mips/sys/mips/mips/tick.c Modified: projects/mips/sys/mips/mips/tick.c ============================================================================== --- projects/mips/sys/mips/mips/tick.c Wed Oct 28 22:00:49 2009 (r198568) +++ projects/mips/sys/mips/mips/tick.c Thu Oct 29 05:18:02 2009 (r198569) @@ -223,9 +223,9 @@ DELAY(int n) /* Check to see if the timer has wrapped around. */ if (cur < last) - delta += (cur + (cycles_per_hz - last)); + delta += cur + (0xffffffff - last) + 1; else - delta += (cur - last); + delta += cur - last; last = cur;