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, CheckpointOut &cp) const
75{
76 // serialize the counters
77 counter[0]->serialize(base + ".counter0", cp);
78 counter[1]->serialize(base + ".counter1", cp);
79 counter[2]->serialize(base + ".counter2", cp);
80}
81
82void
83Intel8254Timer::unserialize(const string &base, CheckpointIn &cp)
84{
85 // unserialze the counters
86 counter[0]->unserialize(base + ".counter0", cp);
87 counter[1]->unserialize(base + ".counter1", cp);
88 counter[2]->unserialize(base + ".counter2", cp);
89}
90
91void
92Intel8254Timer::startup()
93{
94 counter[0]->startup();
95 counter[1]->startup();
96 counter[2]->startup();

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

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

--- 58 unchanged lines hidden ---