Deleted Added
sdiff udiff text old ( 6227:a17798f2a52c ) new ( 7403:3d433863cd41 )
full compact
1/*
2 * Copyright (c) 2004-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 78 unchanged lines hidden (view full) ---

87 Addr totBytes;
88
89 /** Number of bytes that have been acked for this transaction. */
90 Addr numBytes;
91
92 /** Amount to delay completion of dma by */
93 Tick delay;
94
95 DmaReqState(Event *ce, Port *p, Addr tb, Tick _delay)
96 : completionEvent(ce), outPort(p), totBytes(tb), numBytes(0),
97 delay(_delay)
98 {}
99 };
100
101 DmaDevice *device;
102 std::list<PacketPtr> transmitList;
103
104 /** The system that device/port are in. This is used to select which mode
105 * we are currently operating in. */
106 System *sys;
107
108 /** Number of outstanding packets the dma port has. */
109 int pendingCount;

--- 4 unchanged lines hidden (view full) ---

114 /** If we need to drain, keep the drain event around until we're done
115 * here.*/
116 Event *drainEvent;
117
118 /** time to wait between sending another packet, increases as NACKs are
119 * recived, decreases as responses are recived. */
120 Tick backoffTime;
121
122 /** If the port is currently waiting for a retry before it can send whatever
123 * it is that it's sending. */
124 bool inRetry;
125
126 virtual bool recvTiming(PacketPtr pkt);
127 virtual Tick recvAtomic(PacketPtr pkt)
128 { panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN }
129 virtual void recvFunctional(PacketPtr pkt)

--- 10 unchanged lines hidden (view full) ---

140
141 void queueDma(PacketPtr pkt, bool front = false);
142 void sendDma();
143
144 /** event to give us a kick every time we backoff time is reached. */
145 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
146
147 public:
148 DmaPort(DmaDevice *dev, System *s);
149
150 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
151 uint8_t *data, Tick delay);
152
153 bool dmaPending() { return pendingCount > 0; }
154
155 unsigned cacheBlockSize() const { return peerBlockSize(); }
156 unsigned int drain(Event *de);

--- 94 unchanged lines hidden (view full) ---

251 void addressRanges(AddrRangeList &range_list);
252
253};
254
255class DmaDevice : public PioDevice
256{
257 protected:
258 DmaPort *dmaPort;
259 Tick minBackoffDelay;
260 Tick maxBackoffDelay;
261
262 public:
263 typedef DmaDeviceParams Params;
264 DmaDevice(const Params *p);
265 virtual ~DmaDevice();
266
267 const Params *
268 params() const

--- 24 unchanged lines hidden (view full) ---

293 fatal("%s: pio port already connected to %s",
294 name(), pioPort->getPeer()->name());
295 pioPort = new PioPort(this, sys);
296 return pioPort;
297 } else if (if_name == "dma") {
298 if (dmaPort != NULL)
299 fatal("%s: dma port already connected to %s",
300 name(), dmaPort->getPeer()->name());
301 dmaPort = new DmaPort(this, sys);
302 return dmaPort;
303 } else
304 return NULL;
305 }
306
307 friend class DmaPort;
308};
309
310
311#endif // __DEV_IO_DEVICE_HH__