Deleted Added
sdiff udiff text old ( 10642:9d3b6e7dd205 ) new ( 10905:a6ca6831e775 )
full compact
1/*
2 * Copyright (c) 2004, 2005
3 * The Regents of The University of Michigan
4 * All Rights Reserved
5 *
6 * This code is part of the M5 simulator.
7 *
8 * Permission is granted to use, copy, create derivative works and

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

66 else {
67 counter[sel]->setRW(data.rw);
68 counter[sel]->setMode(data.mode);
69 counter[sel]->setBCD(data.bcd);
70 }
71}
72
73void
74Intel8254Timer::serialize(const string &base, ostream &os)
75{
76 // serialize the counters
77 counter[0]->serialize(base + ".counter0", os);
78 counter[1]->serialize(base + ".counter1", os);
79 counter[2]->serialize(base + ".counter2", os);
80}
81
82void
83Intel8254Timer::unserialize(const string &base, Checkpoint *cp,
84 const string &section)
85{
86 // unserialze the counters
87 counter[0]->unserialize(base + ".counter0", cp, section);
88 counter[1]->unserialize(base + ".counter1", cp, section);
89 counter[2]->unserialize(base + ".counter2", cp, section);
90}
91
92void
93Intel8254Timer::startup()
94{
95 counter[0]->startup();
96 counter[1]->startup();
97 counter[2]->startup();

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

224
225bool
226Intel8254Timer::Counter::outputHigh()
227{
228 return output_high;
229}
230
231void
232Intel8254Timer::Counter::serialize(const string &base, ostream &os)
233{
234 paramOut(os, base + ".initial_count", initial_count);
235 paramOut(os, base + ".latched_count", latched_count);
236 paramOut(os, base + ".period", period);
237 paramOut(os, base + ".mode", mode);
238 paramOut(os, base + ".output_high", output_high);
239 paramOut(os, base + ".latch_on", latch_on);
240 paramOut(os, base + ".read_byte", read_byte);
241 paramOut(os, base + ".write_byte", write_byte);
242
243 Tick event_tick_offset = 0;
244 if (event.scheduled())
245 event_tick_offset = event.when() - curTick();
246 paramOut(os, base + ".event_tick_offset", event_tick_offset);
247}
248
249void
250Intel8254Timer::Counter::unserialize(const string &base, Checkpoint *cp,
251 const string &section)
252{
253 paramIn(cp, section, base + ".initial_count", initial_count);
254 paramIn(cp, section, base + ".latched_count", latched_count);
255 paramIn(cp, section, base + ".period", period);
256 paramIn(cp, section, base + ".mode", mode);
257 paramIn(cp, section, base + ".output_high", output_high);
258 paramIn(cp, section, base + ".latch_on", latch_on);
259 paramIn(cp, section, base + ".read_byte", read_byte);
260 paramIn(cp, section, base + ".write_byte", write_byte);
261
262 Tick event_tick_offset = 0;
263 assert(!event.scheduled());
264 paramIn(cp, section, base + ".event_tick_offset", event_tick_offset);
265 offset = event_tick_offset;
266}
267
268void
269Intel8254Timer::Counter::startup()
270{
271 running = true;
272 if ((period > 0) && (offset > 0))

--- 58 unchanged lines hidden ---