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 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 /**
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
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 §ion);
247};
248
249#endif // __DEV_8254_HH__
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 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 /**
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
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 §ion);
247};
248
249#endif // __DEV_8254_HH__