diff options
author | Cagdas Dirik <cdirik@micron.com> | 2015-01-03 17:51:48 -0600 |
---|---|---|
committer | Cagdas Dirik <cdirik@micron.com> | 2015-01-03 17:51:48 -0600 |
commit | 02c376ac44584484268bd714a45fa0f0265a896a (patch) | |
tree | 8bcd4be1ea858883cf68cc40e1142aaca1b8e6e3 /src/dev/mc146818.hh | |
parent | 1ee70e9d84b769b736348e1f7709bc8ede344ec2 (diff) | |
download | gem5-02c376ac44584484268bd714a45fa0f0265a896a.tar.xz |
dev: prevent RTC events firing before startup
This change includes edits to MC146818 timer to prevent RTC events
firing before startup to comply with SimObject initialization call sequence.
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/dev/mc146818.hh')
-rw-r--r-- | src/dev/mc146818.hh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dev/mc146818.hh b/src/dev/mc146818.hh index 76cd40c37..936f597d0 100644 --- a/src/dev/mc146818.hh +++ b/src/dev/mc146818.hh @@ -51,6 +51,7 @@ class MC146818 : public EventManager { MC146818 * parent; Tick interval; + Tick offset; RTCEvent(MC146818 * _parent, Tick i); @@ -68,11 +69,11 @@ class MC146818 : public EventManager 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(); @@ -153,6 +154,9 @@ class MC146818 : public EventManager bool bcd, Tick frequency); virtual ~MC146818(); + /** Start ticking */ + virtual void startup(); + /** RTC write data */ void writeData(const uint8_t addr, const uint8_t data); |