diff options
author | neel <neel@FreeBSD.org> | 2009-10-29 05:18:02 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2009-10-29 05:18:02 +0000 |
commit | 8f48fd489ca9aedf98fa043f148f59c2317df2c0 (patch) | |
tree | 61d637642a30d9974d28a7821e1068e5b88b9ac9 /sys | |
parent | 16239c304f3f273477eb8ef97a0d44d0afd95da0 (diff) | |
download | FreeBSD-src-8f48fd489ca9aedf98fa043f148f59c2317df2c0.zip FreeBSD-src-8f48fd489ca9aedf98fa043f148f59c2317df2c0.tar.gz |
Deal with overflow of the COUNT register correctly. The 'cycles_per_hz'
has nothing to do with the rollover.
Approved by: imp (mentor)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/mips/mips/tick.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/mips/mips/tick.c b/sys/mips/mips/tick.c index d767950..42f34a7 100644 --- a/sys/mips/mips/tick.c +++ b/sys/mips/mips/tick.c @@ -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; |