io_device.hh (8914:8c3bd7bea667) io_device.hh (8922:17f037ad8918)
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;

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

64 virtual AddrRangeList getAddrRanges();
65
66 public:
67
68 PioPort(PioDevice *dev);
69};
70
71
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;

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

64 virtual AddrRangeList getAddrRanges();
65
66 public:
67
68 PioPort(PioDevice *dev);
69};
70
71
72class DmaPort : public Port
72class DmaPort : public MasterPort
73{
74 protected:
75 struct DmaReqState : public Packet::SenderState, public FastAlloc
76 {
77 /** Event to call on the device when this transaction (all packets)
78 * complete. */
79 Event *completionEvent;
80

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

143 }
144 virtual void recvFunctional(PacketPtr pkt)
145 {
146 if (recvSnoops) return;
147
148 panic("dma port shouldn't be used for pio access.");
149 }
150
73{
74 protected:
75 struct DmaReqState : public Packet::SenderState, public FastAlloc
76 {
77 /** Event to call on the device when this transaction (all packets)
78 * complete. */
79 Event *completionEvent;
80

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

143 }
144 virtual void recvFunctional(PacketPtr pkt)
145 {
146 if (recvSnoops) return;
147
148 panic("dma port shouldn't be used for pio access.");
149 }
150
151 virtual void recvRangeChange()
152 {
153 // DMA port is a master with a single slave so there is no choice and
154 // thus no need to worry about any address changes
155 }
156
157 virtual void recvRetry() ;
158
151 virtual void recvRetry() ;
152
159 virtual bool isSnooping()
160 { return recvSnoops; }
153 virtual bool isSnooping() const { return recvSnoops; }
161
162 void queueDma(PacketPtr pkt, bool front = false);
163 void sendDma();
164
165 /** event to give us a kick every time we backoff time is reached. */
166 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
167
168 public:

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

226 {
227 return dynamic_cast<const Params *>(_params);
228 }
229
230 virtual void init();
231
232 virtual unsigned int drain(Event *de);
233
154
155 void queueDma(PacketPtr pkt, bool front = false);
156 void sendDma();
157
158 /** event to give us a kick every time we backoff time is reached. */
159 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
160
161 public:

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

219 {
220 return dynamic_cast<const Params *>(_params);
221 }
222
223 virtual void init();
224
225 virtual unsigned int drain(Event *de);
226
234 virtual Port *getPort(const std::string &if_name, int idx = -1);
227 virtual SlavePort &getSlavePort(const std::string &if_name, int idx = -1);
235
236 friend class PioPort;
237
238};
239
240class BasicPioDevice : public PioDevice
241{
242 protected:

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

299 bool dmaPending() { return dmaPort.dmaPending(); }
300
301 virtual void init();
302
303 virtual unsigned int drain(Event *de);
304
305 unsigned cacheBlockSize() const { return dmaPort.cacheBlockSize(); }
306
228
229 friend class PioPort;
230
231};
232
233class BasicPioDevice : public PioDevice
234{
235 protected:

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

292 bool dmaPending() { return dmaPort.dmaPending(); }
293
294 virtual void init();
295
296 virtual unsigned int drain(Event *de);
297
298 unsigned cacheBlockSize() const { return dmaPort.cacheBlockSize(); }
299
307 virtual Port *getPort(const std::string &if_name, int idx = -1);
300 virtual MasterPort &getMasterPort(const std::string &if_name,
301 int idx = -1);
308
309 friend class DmaPort;
310};
311
312
313#endif // __DEV_IO_DEVICE_HH__
302
303 friend class DmaPort;
304};
305
306
307#endif // __DEV_IO_DEVICE_HH__