summaryrefslogtreecommitdiff
path: root/src/dev/io_device.hh
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2010-06-02 12:58:16 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2010-06-02 12:58:16 -0500
commitf246be4cbc27b4173f6917b430a31b9a39cdb380 (patch)
tree20a36c989e5040445534ecd58ceae3d13ee152f7 /src/dev/io_device.hh
parent1546d8208b2013af1dc1951f7cb35857f2e50897 (diff)
downloadgem5-f246be4cbc27b4173f6917b430a31b9a39cdb380.tar.xz
DMA: Make DmaPort generic enough to be used other places
Diffstat (limited to 'src/dev/io_device.hh')
-rw-r--r--src/dev/io_device.hh16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/dev/io_device.hh b/src/dev/io_device.hh
index 54128e48f..9ed287589 100644
--- a/src/dev/io_device.hh
+++ b/src/dev/io_device.hh
@@ -92,13 +92,14 @@ class DmaPort : public Port
/** Amount to delay completion of dma by */
Tick delay;
+
DmaReqState(Event *ce, Port *p, Addr tb, Tick _delay)
: completionEvent(ce), outPort(p), totBytes(tb), numBytes(0),
delay(_delay)
{}
};
- DmaDevice *device;
+ MemObject *device;
std::list<PacketPtr> transmitList;
/** The system that device/port are in. This is used to select which mode
@@ -119,6 +120,12 @@ class DmaPort : public Port
* recived, decreases as responses are recived. */
Tick backoffTime;
+ /** Minimum time that device should back off for after failed sendTiming */
+ Tick minBackoffDelay;
+
+ /** Maximum time that device should back off for after failed sendTiming */
+ Tick maxBackoffDelay;
+
/** If the port is currently waiting for a retry before it can send whatever
* it is that it's sending. */
bool inRetry;
@@ -145,7 +152,7 @@ class DmaPort : public Port
EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
public:
- DmaPort(DmaDevice *dev, System *s);
+ DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff);
void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
uint8_t *data, Tick delay);
@@ -256,8 +263,6 @@ class DmaDevice : public PioDevice
{
protected:
DmaPort *dmaPort;
- Tick minBackoffDelay;
- Tick maxBackoffDelay;
public:
typedef DmaDeviceParams Params;
@@ -298,7 +303,8 @@ class DmaDevice : public PioDevice
if (dmaPort != NULL)
fatal("%s: dma port already connected to %s",
name(), dmaPort->getPeer()->name());
- dmaPort = new DmaPort(this, sys);
+ dmaPort = new DmaPort(this, sys, params()->min_backoff_delay,
+ params()->max_backoff_delay);
return dmaPort;
} else
return NULL;