mc146818.hh (7559:017baf09599f) mc146818.hh (7683:f81f5f27592b)
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

114 void setTime(const struct tm time);
115
116 /** RTC status register A */
117 uint8_t stat_regA;
118
119 /** RTC status register B */
120 uint8_t stat_regB;
121
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

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

114 void setTime(const struct tm time);
115
116 /** RTC status register A */
117 uint8_t stat_regA;
118
119 /** RTC status register B */
120 uint8_t stat_regB;
121
122 /** RTC event times for drain and serialization coordination */
123 Tick rtcTimerInterruptTickOffset;
124 Tick rtcClockTickOffset;
125
126 public:
127 MC146818(EventManager *em, const std::string &name, const struct tm time,
128 bool bcd, Tick frequency);
129 virtual ~MC146818();
130
131 /** RTC write data */
132 void writeData(const uint8_t addr, const uint8_t data);
133
134 /** RTC read data */
135 uint8_t readData(const uint8_t addr);
136
137 void tickClock();
138
122 public:
123 MC146818(EventManager *em, const std::string &name, const struct tm time,
124 bool bcd, Tick frequency);
125 virtual ~MC146818();
126
127 /** RTC write data */
128 void writeData(const uint8_t addr, const uint8_t data);
129
130 /** RTC read data */
131 uint8_t readData(const uint8_t addr);
132
133 void tickClock();
134
139 unsigned int drain(Event *de);
140
141 /**
142 * Serialize this object to the given output stream.
143 * @param base The base name of the counter object.
144 * @param os The stream to serialize to.
145 */
146 void serialize(const std::string &base, std::ostream &os);
147
148 /**
149 * Reconstruct the state of this object from a checkpoint.
150 * @param base The base name of the counter object.
151 * @param cp The checkpoint use.
152 * @param section The section name of this object
153 */
154 void unserialize(const std::string &base, Checkpoint *cp,
155 const std::string &section);
156};
157
158#endif // __DEV_MC146818_HH__
135 /**
136 * Serialize this object to the given output stream.
137 * @param base The base name of the counter object.
138 * @param os The stream to serialize to.
139 */
140 void serialize(const std::string &base, std::ostream &os);
141
142 /**
143 * Reconstruct the state of this object from a checkpoint.
144 * @param base The base name of the counter object.
145 * @param cp The checkpoint use.
146 * @param section The section name of this object
147 */
148 void unserialize(const std::string &base, Checkpoint *cp,
149 const std::string &section);
150};
151
152#endif // __DEV_MC146818_HH__