Deleted Added
sdiff udiff text old ( 7559:017baf09599f ) new ( 7683:f81f5f27592b )
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

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

132 enum {LSB, MSB};
133
134 /** Determine which byte of a 16-bit count value to read/write */
135 uint8_t read_byte, write_byte;
136
137 /** Pointer to container */
138 Intel8254Timer *parent;
139
140 /** if non-zero, the scheduled tick of an event used for drain
141 serialization coordination */
142 Tick event_tick;
143
144 public:
145 Counter(Intel8254Timer *p, const std::string &name, unsigned int num);
146
147 /** Latch the current count (if one is not already latched) */
148 void latchCount();
149
150 /** Get the current count for this counter */
151 int currentCount();

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

164
165 /** Write a count byte */
166 void write(const uint8_t data);
167
168 /** Is the output high? */
169 bool outputHigh();
170
171 /**
172 * Drain all associated events.
173 * @param drainEvent
174 */
175 unsigned int drain(Event *de);
176
177 /**
178 * Serialize this object to the given output stream.
179 * @param base The base name of the counter object.
180 * @param os The stream to serialize to.
181 */
182 void serialize(const std::string &base, std::ostream &os);
183
184 /**
185 * Reconstruct the state of this object from a checkpoint.

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

234
235 bool
236 outputHigh(unsigned int num)
237 {
238 assert(num < 3);
239 return counter[num]->outputHigh();
240 }
241
242 unsigned int drain(Event *de);
243
244 /**
245 * Serialize this object to the given output stream.
246 * @param base The base name of the counter object.
247 * @param os The stream to serialize to.
248 */
249 void serialize(const std::string &base, std::ostream &os);
250
251 /**
252 * Reconstruct the state of this object from a checkpoint.
253 * @param base The base name of the counter object.
254 * @param cp The checkpoint use.
255 * @param section The section name of this object
256 */
257 void unserialize(const std::string &base, Checkpoint *cp,
258 const std::string &section);
259};
260
261#endif // __DEV_8254_HH__