rtc.unserialize("rtc", cp, section);
}
+void
+TsunamiIO::startup()
+{
+ rtc.startup();
+}
+
TsunamiIO *
TsunamiIOParams::create()
{
*/
virtual void unserialize(Checkpoint *cp, const std::string §ion);
+ /**
+ * Start running.
+ */
+ virtual void startup();
+
};
#endif // __DEV_TSUNAMI_IO_HH__
#include "debug/Timer.hh"
#include "dev/arm/amba_device.hh"
#include "dev/arm/rtc_pl031.hh"
-#include "dev/mc146818.hh"
#include "mem/packet.hh"
#include "mem/packet_access.hh"
reg.dv == RTCA_DV_DISABLED1;
}
+void
+MC146818::startup()
+{
+ assert(!event.scheduled());
+ assert(!tickEvent.scheduled());
+ schedule(event, curTick() + event.offset);
+ schedule(tickEvent, curTick() + tickEvent.offset);
+}
+
void
MC146818::writeData(const uint8_t addr, const uint8_t data)
{
//
Tick rtcTimerInterruptTickOffset;
UNSERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
- reschedule(event, curTick() + rtcTimerInterruptTickOffset);
+ event.offset = rtcTimerInterruptTickOffset;
Tick rtcClockTickOffset;
UNSERIALIZE_SCALAR(rtcClockTickOffset);
- reschedule(tickEvent, curTick() + rtcClockTickOffset);
+ tickEvent.offset = rtcClockTickOffset;
}
MC146818::RTCEvent::RTCEvent(MC146818 * _parent, Tick i)
- : parent(_parent), interval(i)
+ : parent(_parent), interval(i), offset(i)
{
DPRINTF(MC146818, "RTC Event Initilizing\n");
- parent->schedule(this, curTick() + interval);
}
void
{
MC146818 * parent;
Tick interval;
+ Tick offset;
RTCEvent(MC146818 * _parent, Tick i);
struct RTCTickEvent : public Event
{
MC146818 * parent;
+ Tick offset;
- RTCTickEvent(MC146818 * _parent) : parent(_parent)
- {
- parent->schedule(this, curTick() + SimClock::Int::s);
- }
+ RTCTickEvent(MC146818 * _parent) :
+ parent(_parent), offset(SimClock::Int::s)
+ {}
/** Event process to occur at interrupt*/
void process();
bool bcd, Tick frequency);
virtual ~MC146818();
+ /** Start ticking */
+ virtual void startup();
+
/** RTC write data */
void writeData(const uint8_t addr, const uint8_t data);
rtc.unserialize("rtc", cp, section);
}
+void
+MaltaIO::startup()
+{
+ rtc.startup();
+}
+
MaltaIO *
MaltaIOParams::create()
{
*/
virtual void unserialize(Checkpoint *cp, const std::string §ion);
+ /**
+ * Start running.
+ */
+ virtual void startup();
+
};
#endif // __DEV_MALTA_IO_HH__
}
}
+void
+X86ISA::Cmos::startup()
+{
+ rtc.startup();
+}
+
void
X86ISA::Cmos::serialize(std::ostream &os)
{
Tick write(PacketPtr pkt);
+ virtual void startup();
virtual void serialize(std::ostream &os);
virtual void unserialize(Checkpoint *cp, const std::string §ion);