summaryrefslogtreecommitdiff
path: root/src/dev/io_device.hh
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2011-10-28 13:04:33 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2011-10-28 13:04:33 -0500
commit706323fa21de674d8064c95a3c0036f0342430ee (patch)
tree40bcf3249c0d9d9b21a70f65f0e56ca9020017f7 /src/dev/io_device.hh
parentcbaebb3b5ebe709689f481ad395034335bea2152 (diff)
parent6f9d294e8685f49d91af48065736ac1d67e53718 (diff)
downloadgem5-706323fa21de674d8064c95a3c0036f0342430ee.tar.xz
Merged with recent changes.
Diffstat (limited to 'src/dev/io_device.hh')
-rw-r--r--src/dev/io_device.hh32
1 files changed, 3 insertions, 29 deletions
diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh
index bc6f1d4f7..812c276d6 100644
--- a/src/dev/io_device.hh
+++ b/src/dev/io_device.hh
@@ -215,17 +215,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;
};
@@ -291,24 +282,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;
};