dev: (un)serialize fix for the RTC and RTC Timer Interrupt events

Restoring from a checkpoint fails if either the RTC or the RTC Timer
Interrrupt event is disabled. The restored machine tried incorrectly
to schedule the next event with negative offset.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>
This commit is contained in:
Nikos Nikoleris 2015-04-03 11:42:10 -05:00
parent bebab7f24f
commit 4bdbdd8413

View file

@ -127,8 +127,11 @@ MC146818::startup()
{
assert(!event.scheduled());
assert(!tickEvent.scheduled());
schedule(event, curTick() + event.offset);
schedule(tickEvent, curTick() + tickEvent.offset);
if (stat_regB.pie)
schedule(event, curTick() + event.offset);
if (!rega_dv_disabled(stat_regA))
schedule(tickEvent, curTick() + tickEvent.offset);
}
void