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

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;