summaryrefslogtreecommitdiff
path: root/src/dev/mc146818.cc
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2009-10-15 15:15:24 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2009-10-15 15:15:24 -0700
commit28204b2a964983738726428269e61833f4e1dce9 (patch)
tree5ee8b08fb193d39e02c71b2e73fd7b56db04124b /src/dev/mc146818.cc
parent30a185dcd04cc7797609398219482d03a68509f9 (diff)
downloadgem5-28204b2a964983738726428269e61833f4e1dce9.tar.xz
fixed MC146818 checkpointing bug and added isa serialization calls to simple_thread
Diffstat (limited to 'src/dev/mc146818.cc')
-rw-r--r--src/dev/mc146818.cc22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/dev/mc146818.cc b/src/dev/mc146818.cc
index b25b015d2..0bb6558c8 100644
--- a/src/dev/mc146818.cc
+++ b/src/dev/mc146818.cc
@@ -207,6 +207,15 @@ MC146818::serialize(const string &base, ostream &os)
arrayParamOut(os, base + ".clock_data", clock_data, sizeof(clock_data));
paramOut(os, base + ".stat_regA", stat_regA);
paramOut(os, base + ".stat_regB", stat_regB);
+
+ //
+ // save the timer tick and rtc clock tick values to correctly reschedule
+ // them during unserialize
+ //
+ Tick rtcTimerInterruptTickOffset = event.when() - curTick;
+ SERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
+ Tick rtcClockTickOffset = event.when() - curTick;
+ SERIALIZE_SCALAR(rtcClockTickOffset);
}
void
@@ -218,10 +227,15 @@ MC146818::unserialize(const string &base, Checkpoint *cp,
paramIn(cp, section, base + ".stat_regA", stat_regA);
paramIn(cp, section, base + ".stat_regB", stat_regB);
- // We're not unserializing the event here, but we need to
- // rescehedule the event since curTick was moved forward by the
- // checkpoint
- reschedule(event, curTick + event.interval);
+ //
+ // properly schedule the timer and rtc clock events
+ //
+ Tick rtcTimerInterruptTickOffset;
+ UNSERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
+ reschedule(event, curTick + rtcTimerInterruptTickOffset);
+ Tick rtcClockTickOffset;
+ UNSERIALIZE_SCALAR(rtcClockTickOffset);
+ reschedule(tickEvent, curTick + rtcClockTickOffset);
}
MC146818::RTCEvent::RTCEvent(MC146818 * _parent, Tick i)