From 4bdbdd84136d75272cb1df6444746c8ff669893e Mon Sep 17 00:00:00 2001 From: Nikos Nikoleris Date: Fri, 3 Apr 2015 11:42:10 -0500 Subject: [PATCH] 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 --- src/dev/mc146818.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dev/mc146818.cc b/src/dev/mc146818.cc index fa8350760..b5467f8cc 100644 --- a/src/dev/mc146818.cc +++ b/src/dev/mc146818.cc @@ -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 -- 2.30.2