diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2011-10-28 13:04:33 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2011-10-28 13:04:33 -0500 |
commit | 706323fa21de674d8064c95a3c0036f0342430ee (patch) | |
tree | 40bcf3249c0d9d9b21a70f65f0e56ca9020017f7 /src/dev/io_device.cc | |
parent | cbaebb3b5ebe709689f481ad395034335bea2152 (diff) | |
parent | 6f9d294e8685f49d91af48065736ac1d67e53718 (diff) | |
download | gem5-706323fa21de674d8064c95a3c0036f0342430ee.tar.xz |
Merged with recent changes.
Diffstat (limited to 'src/dev/io_device.cc')
-rw-r--r-- | src/dev/io_device.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/dev/io_device.cc b/src/dev/io_device.cc index bfdf3d486..5e2395bf9 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); +} + |