summaryrefslogtreecommitdiff
path: root/src/dev/mc146818.cc
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-10-09 04:58:24 -0700
committerNathan Binkert <nate@binkert.org>2008-10-09 04:58:24 -0700
commite06321091d4e931ff1a4d753e56d76f9746c3cd2 (patch)
tree75e2049ca5ffc65cbfaefa73804571aa933f015b /src/dev/mc146818.cc
parent8291d9db0a0bdeecb2a13f28962893ed3659230e (diff)
downloadgem5-e06321091d4e931ff1a4d753e56d76f9746c3cd2.tar.xz
eventq: convert all usage of events to use the new API.
For now, there is still a single global event queue, but this is necessary for making the steps towards a parallelized m5.
Diffstat (limited to 'src/dev/mc146818.cc')
-rw-r--r--src/dev/mc146818.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/dev/mc146818.cc b/src/dev/mc146818.cc
index 984422105..e5a81ff75 100644
--- a/src/dev/mc146818.cc
+++ b/src/dev/mc146818.cc
@@ -42,9 +42,9 @@
using namespace std;
-MC146818::MC146818(const string &n, const struct tm time,
- bool bcd, Tick frequency)
- : _name(n), event(this, frequency)
+MC146818::MC146818(EventManager *em, const string &n, const struct tm time,
+ bool bcd, Tick frequency)
+ : EventManager(em), _name(n), event(this, frequency)
{
memset(clock_data, 0, sizeof(clock_data));
stat_regA = RTCA_32768HZ | RTCA_1024HZ;
@@ -75,6 +75,10 @@ MC146818::MC146818(const string &n, const struct tm time,
DPRINTFN("Real-time clock set to %s", asctime(&time));
}
+MC146818::~MC146818()
+{
+}
+
void
MC146818::writeData(const uint8_t addr, const uint8_t data)
{
@@ -96,7 +100,7 @@ MC146818::writeData(const uint8_t addr, const uint8_t data)
event.scheduleIntr();
} else {
if (event.scheduled())
- event.deschedule();
+ deschedule(event);
}
stat_regB = data;
break;
@@ -153,27 +157,27 @@ MC146818::unserialize(const string &base, Checkpoint *cp,
// We're not unserializing the event here, but we need to
// rescehedule the event since curTick was moved forward by the
// checkpoint
- event.reschedule(curTick + event.interval);
+ reschedule(event, curTick + event.interval);
}
MC146818::RTCEvent::RTCEvent(MC146818 * _parent, Tick i)
- : Event(&mainEventQueue), parent(_parent), interval(i)
+ : parent(_parent), interval(i)
{
DPRINTF(MC146818, "RTC Event Initilizing\n");
- schedule(curTick + interval);
+ parent->schedule(this, curTick + interval);
}
void
MC146818::RTCEvent::scheduleIntr()
{
- schedule(curTick + interval);
+ parent->schedule(this, curTick + interval);
}
void
MC146818::RTCEvent::process()
{
DPRINTF(MC146818, "RTC Timer Interrupt\n");
- schedule(curTick + interval);
+ parent->schedule(this, curTick + interval);
parent->handleEvent();
}