From 283be34a992401f07d62e274d501c4185fca8377 Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Fri, 20 Aug 2010 11:46:13 -0700 Subject: devices: Fixed periodic interrupts to work with draining Added drain functions to the RTC and 8254 timer so that periodic interrupts stop when the system is draining. This patch is needed to checkpoint in timing mode. Otherwise under certain situations, the event queue will never be completely empty. --- src/dev/alpha/tsunami_io.cc | 11 +++++++++++ src/dev/alpha/tsunami_io.hh | 6 ++++++ 2 files changed, 17 insertions(+) (limited to 'src/dev/alpha') diff --git a/src/dev/alpha/tsunami_io.cc b/src/dev/alpha/tsunami_io.cc index c90f06b5a..1a76c2c32 100644 --- a/src/dev/alpha/tsunami_io.cc +++ b/src/dev/alpha/tsunami_io.cc @@ -249,6 +249,17 @@ TsunamiIO::clearPIC(uint8_t bitvector) } } +unsigned int +TsunamiIO::drain(Event *de) +{ + unsigned int count = 0; + count += pitimer.drain(de); + count += rtc.drain(de); + assert(count == 0); + changeState(SimObject::Drained); + return count; +} + void TsunamiIO::serialize(ostream &os) { diff --git a/src/dev/alpha/tsunami_io.hh b/src/dev/alpha/tsunami_io.hh index b6d63322b..f649247e2 100644 --- a/src/dev/alpha/tsunami_io.hh +++ b/src/dev/alpha/tsunami_io.hh @@ -140,6 +140,12 @@ class TsunamiIO : public BasicPioDevice */ void clearPIC(uint8_t bitvector); + /** + * Drain the io state including all associated events. + * @param drainEvent + */ + unsigned int drain(Event *de); + /** * Serialize this object to the given output stream. * @param os The stream to serialize to. -- cgit v1.2.3