intel_8254_timer.cc (10642:9d3b6e7dd205) | intel_8254_timer.cc (10905:a6ca6831e775) |
---|---|
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 | 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) | 74Intel8254Timer::serialize(const string &base, CheckpointOut &cp) const |
75{ 76 // serialize the counters | 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); | 77 counter[0]->serialize(base + ".counter0", cp); 78 counter[1]->serialize(base + ".counter1", cp); 79 counter[2]->serialize(base + ".counter2", cp); |
80} 81 82void | 80} 81 82void |
83Intel8254Timer::unserialize(const string &base, Checkpoint *cp, 84 const string §ion) | 83Intel8254Timer::unserialize(const string &base, CheckpointIn &cp) |
85{ 86 // unserialze the counters | 84{ 85 // 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); | 86 counter[0]->unserialize(base + ".counter0", cp); 87 counter[1]->unserialize(base + ".counter1", cp); 88 counter[2]->unserialize(base + ".counter2", cp); |
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 | 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 |
232Intel8254Timer::Counter::serialize(const string &base, ostream &os) | 231Intel8254Timer::Counter::serialize(const string &base, CheckpointOut &cp) const |
233{ | 232{ |
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); | 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); |
242 243 Tick event_tick_offset = 0; 244 if (event.scheduled()) 245 event_tick_offset = event.when() - curTick(); | 241 242 Tick event_tick_offset = 0; 243 if (event.scheduled()) 244 event_tick_offset = event.when() - curTick(); |
246 paramOut(os, base + ".event_tick_offset", event_tick_offset); | 245 paramOut(cp, base + ".event_tick_offset", event_tick_offset); |
247} 248 249void | 246} 247 248void |
250Intel8254Timer::Counter::unserialize(const string &base, Checkpoint *cp, 251 const string §ion) | 249Intel8254Timer::Counter::unserialize(const string &base, CheckpointIn &cp) |
252{ | 250{ |
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); | 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); |
261 262 Tick event_tick_offset = 0; 263 assert(!event.scheduled()); | 259 260 Tick event_tick_offset = 0; 261 assert(!event.scheduled()); |
264 paramIn(cp, section, base + ".event_tick_offset", event_tick_offset); | 262 paramIn(cp, 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 --- | 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 --- |