On a few systems the timer tick can run too fast (eg it's 0.512 of a second
not 0.5) and we can tick ahead of the RTC time. For robustness treat being
a second ahead of locked time as we do being on time - don't tick again so
we'll slide into time.
We shouldn't end up any further out because the big jumps are only when we
have interrupts off for stuff like floppy disk I/O. In that situation we
will always lose time.
slide = rtcnew - rtcsec; /* Seconds elapsed */
rtcsec = rtcnew;
/*
- * FIXME: it would be nice if we see a backwards slide of 1 or 2
- * to stall the OS clock so we can use an rtc to track a not so
- * stable system clock.
+ * We assume a small negative warp in seconds is telling us
+ * that the clock is running too fast and we should stall.
*/
+ if (slide == -1)
+ return;
addtod:
if (slide < 0)
slide += 60; /* Seconds wrapped */