Add code to the BIOS VM86 emulator to detect writes to the 8254. If a
write is detected the 8254 is reset after the bios call returns and the
event is reported. Some bioses, in particular video bioses, uses timer 2
for timing things. We need timer 2 for our master clock.
Remove restoreclocks(). This was causing gd_cpuclock_base to reverse index
and jump the time ahead an hour with a flurry of hardclock interrupts.
Introduce a new systimer API call, systimer_init_periodic_nq(), which
installs a non-queued periodic systimer. Non-queued means that if multiple
events built-up (due to an 8254 glitch, sleep, or other event), only one
event will be reported.
This should fix the BIOS/8254 glitching, the 'hour jump' problem, and
hopefully other timer jumping issues as well.
Bugs-reported-by: Andreas Hauser <andy@splashground.de>,
Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>,
and others