summaryrefslogtreecommitdiff
path: root/src/dev
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2012-01-07 02:10:34 -0800
committerGabe Black <gblack@eecs.umich.edu>2012-01-07 02:10:34 -0800
commit36a822f08e88483b41af214ace4fd3dccf3aa8cb (patch)
treed7c4c08590459d967a1d7638b02c586911826953 /src/dev
parent85424bef192c02a47c0d46c2d99ac0a5d6e55a99 (diff)
parentf171a29118e1d80c04c72d2fb5f024fed4fb62af (diff)
downloadgem5-36a822f08e88483b41af214ace4fd3dccf3aa8cb.tar.xz
Merge with main repository.
Diffstat (limited to 'src/dev')
-rw-r--r--src/dev/io_device.cc28
-rw-r--r--src/dev/io_device.hh32
-rw-r--r--src/dev/mc146818.cc2
3 files changed, 32 insertions, 30 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc
index 3c64e2717..62e4a9c37 100644
--- a/src/dev/io_device.cc
+++ b/src/dev/io_device.cc
@@ -75,6 +75,18 @@ PioDevice::init()
pioPort->sendStatusChange(Port::RangeChange);
}
+Port *
+PioDevice::getPort(const std::string &if_name, int idx)
+{
+ if (if_name == "pio") {
+ if (pioPort != NULL)
+ fatal("%s: pio port already connected to %s",
+ name(), pioPort->getPeer()->name());
+ pioPort = new PioPort(this, sys);
+ return pioPort;
+ }
+ return NULL;
+}
unsigned int
PioDevice::drain(Event *de)
@@ -349,3 +361,19 @@ DmaDevice::~DmaDevice()
if (dmaPort)
delete dmaPort;
}
+
+
+Port *
+DmaDevice::getPort(const std::string &if_name, int idx)
+{
+ if (if_name == "dma") {
+ if (dmaPort != NULL)
+ fatal("%s: dma port already connected to %s",
+ name(), dmaPort->getPeer()->name());
+ dmaPort = new DmaPort(this, sys, params()->min_backoff_delay,
+ params()->max_backoff_delay);
+ return dmaPort;
+ }
+ return PioDevice::getPort(if_name, idx);
+}
+
diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh
index bdafc34a0..a92402bfe 100644
--- a/src/dev/io_device.hh
+++ b/src/dev/io_device.hh
@@ -209,17 +209,8 @@ class PioDevice : public MemObject
virtual unsigned int drain(Event *de);
- virtual Port *getPort(const std::string &if_name, int idx = -1)
- {
- if (if_name == "pio") {
- if (pioPort != NULL)
- fatal("%s: pio port already connected to %s",
- name(), pioPort->getPeer()->name());
- pioPort = new PioPort(this, sys);
- return pioPort;
- } else
- return NULL;
- }
+ virtual Port *getPort(const std::string &if_name, int idx = -1);
+
friend class PioPort;
};
@@ -285,24 +276,7 @@ class DmaDevice : public PioDevice
unsigned cacheBlockSize() const { return dmaPort->cacheBlockSize(); }
- virtual Port *getPort(const std::string &if_name, int idx = -1)
- {
- if (if_name == "pio") {
- if (pioPort != NULL)
- fatal("%s: pio port already connected to %s",
- name(), pioPort->getPeer()->name());
- pioPort = new PioPort(this, sys);
- return pioPort;
- } else if (if_name == "dma") {
- if (dmaPort != NULL)
- fatal("%s: dma port already connected to %s",
- name(), dmaPort->getPeer()->name());
- dmaPort = new DmaPort(this, sys, params()->min_backoff_delay,
- params()->max_backoff_delay);
- return dmaPort;
- } else
- return NULL;
- }
+ virtual Port *getPort(const std::string &if_name, int idx = -1);
friend class DmaPort;
};
diff --git a/src/dev/mc146818.cc b/src/dev/mc146818.cc
index 9397a599b..b0aaf6e64 100644
--- a/src/dev/mc146818.cc
+++ b/src/dev/mc146818.cc
@@ -217,7 +217,7 @@ MC146818::serialize(const string &base, ostream &os)
//
Tick rtcTimerInterruptTickOffset = event.when() - curTick();
SERIALIZE_SCALAR(rtcTimerInterruptTickOffset);
- Tick rtcClockTickOffset = event.when() - curTick();
+ Tick rtcClockTickOffset = tickEvent.when() - curTick();
SERIALIZE_SCALAR(rtcClockTickOffset);
}