svn commit: r198569 - projects/mips/sys/mips/mips
Neel Natu
neel at FreeBSD.org
Thu Oct 29 05:18:03 UTC 2009
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;
More information about the svn-src-projects
mailing list