Deleted Added
sdiff udiff text old ( 6621:835a99bdab10 ) new ( 6677:b741b3e7164b )
full compact
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 193 unchanged lines hidden (view full) ---

202}
203
204void
205MC146818::serialize(const string &base, ostream &os)
206{
207 arrayParamOut(os, base + ".clock_data", clock_data, sizeof(clock_data));
208 paramOut(os, base + ".stat_regA", stat_regA);
209 paramOut(os, base + ".stat_regB", stat_regB);
210
211 //
212 // save the timer tick and rtc clock tick values to correctly reschedule
213 // them during unserialize
214 //
215 Tick rtcTimerInterruptTickOffset = event.when() - curTick;
216 SERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
217 Tick rtcClockTickOffset = event.when() - curTick;
218 SERIALIZE_SCALAR(rtcClockTickOffset);
219}
220
221void
222MC146818::unserialize(const string &base, Checkpoint *cp,
223 const string &section)
224{
225 arrayParamIn(cp, section, base + ".clock_data", clock_data,
226 sizeof(clock_data));
227 paramIn(cp, section, base + ".stat_regA", stat_regA);
228 paramIn(cp, section, base + ".stat_regB", stat_regB);
229
230 //
231 // properly schedule the timer and rtc clock events
232 //
233 Tick rtcTimerInterruptTickOffset;
234 UNSERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
235 reschedule(event, curTick + rtcTimerInterruptTickOffset);
236 Tick rtcClockTickOffset;
237 UNSERIALIZE_SCALAR(rtcClockTickOffset);
238 reschedule(tickEvent, curTick + rtcClockTickOffset);
239}
240
241MC146818::RTCEvent::RTCEvent(MC146818 * _parent, Tick i)
242 : parent(_parent), interval(i)
243{
244 DPRINTF(MC146818, "RTC Event Initilizing\n");
245 parent->schedule(this, curTick + interval);
246}

--- 34 unchanged lines hidden ---