intel_8254_timer.hh (7559:017baf09599f) intel_8254_timer.hh (7683:f81f5f27592b)
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
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 /**
140 public:
141 Counter(Intel8254Timer *p, const std::string &name, unsigned int num);
142
143 /** Latch the current count (if one is not already latched) */
144 void latchCount();
145
146 /** Get the current count for this counter */
147 int currentCount();

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

160
161 /** Write a count byte */
162 void write(const uint8_t data);
163
164 /** Is the output high? */
165 bool outputHigh();
166
167 /**
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
168 * Serialize this object to the given output stream.
169 * @param base The base name of the counter object.
170 * @param os The stream to serialize to.
171 */
172 void serialize(const std::string &base, std::ostream &os);
173
174 /**
175 * Reconstruct the state of this object from a checkpoint.

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

224
225 bool
226 outputHigh(unsigned int num)
227 {
228 assert(num < 3);
229 return counter[num]->outputHigh();
230 }
231
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__
232 /**
233 * Serialize this object to the given output stream.
234 * @param base The base name of the counter object.
235 * @param os The stream to serialize to.
236 */
237 void serialize(const std::string &base, std::ostream &os);
238
239 /**
240 * Reconstruct the state of this object from a checkpoint.
241 * @param base The base name of the counter object.
242 * @param cp The checkpoint use.
243 * @param section The section name of this object
244 */
245 void unserialize(const std::string &base, Checkpoint *cp,
246 const std::string &section);
247};
248
249#endif // __DEV_8254_HH__