Deleted Added
sdiff udiff text old ( 5606:6da7a58b0bc8 ) new ( 5635:b65e232e7755 )
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

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

30 * Miguel J. Serrano
31 */
32
33#include "base/misc.hh"
34#include "dev/intel_8254_timer.hh"
35
36using namespace std;
37
38Intel8254Timer::Intel8254Timer(EventManager *em, const string &name)
39 : EventManager(em), _name(name),
40 counter0(this, name + ".counter0"),
41 counter1(this, name + ".counter1"),
42 counter2(this, name + ".counter2")
43{
44 counter[0] = &counter0;
45 counter[1] = &counter0;
46 counter[2] = &counter0;
47}
48
49void
50Intel8254Timer::writeControl(const CtrlReg data)
51{
52 int sel = data.sel;
53
54 if (sel == ReadBackCommand)
55 panic("PITimer Read-Back Command is not implemented.\n");
56

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

62 counter[sel]->setBCD(data.bcd);
63 }
64}
65
66void
67Intel8254Timer::serialize(const string &base, ostream &os)
68{
69 // serialize the counters
70 counter0.serialize(base + ".counter0", os);
71 counter1.serialize(base + ".counter1", os);
72 counter2.serialize(base + ".counter2", os);
73}
74
75void
76Intel8254Timer::unserialize(const string &base, Checkpoint *cp,
77 const string &section)
78{
79 // unserialze the counters
80 counter0.unserialize(base + ".counter0", cp, section);
81 counter1.unserialize(base + ".counter1", cp, section);
82 counter2.unserialize(base + ".counter2", cp, section);
83}
84
85Intel8254Timer::Counter::Counter(Intel8254Timer *p, const string &name)
86 : _name(name), event(this), count(0), latched_count(0), period(0),
87 mode(0), output_high(false), latch_on(false), read_byte(LSB),
88 write_byte(LSB), parent(p)
89{
90

--- 181 unchanged lines hidden ---