Deal with overflow of the COUNT register correctly. The 'cycles_per_hz'

has nothing to do with the rollover.

Approved by: imp (mentor)
This commit is contained in:
Neel Natu 2009-10-29 05:18:02 +00:00
parent 64ec125306
commit 131ec9efd8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/mips/; revision=198569

View File

@ -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;