io_device.hh (8795:0909f8ed7aa0) io_device.hh (8796:a2ae5c378d0a)
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;

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

124
125 /** Maximum time that device should back off for after failed sendTiming */
126 Tick maxBackoffDelay;
127
128 /** If the port is currently waiting for a retry before it can send whatever
129 * it is that it's sending. */
130 bool inRetry;
131
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;

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

124
125 /** Maximum time that device should back off for after failed sendTiming */
126 Tick maxBackoffDelay;
127
128 /** If the port is currently waiting for a retry before it can send whatever
129 * it is that it's sending. */
130 bool inRetry;
131
132 /** Port accesses a cache which requires snooping */
133 bool recvSnoops;
134
135 /** Records snoop response so we only reply once to a status change */
136 bool snoopRangeSent;
137
132 virtual bool recvTiming(PacketPtr pkt);
133 virtual Tick recvAtomic(PacketPtr pkt)
138 virtual bool recvTiming(PacketPtr pkt);
139 virtual Tick recvAtomic(PacketPtr pkt)
134 { panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN }
140 {
141 if (recvSnoops) return 0;
142
143 panic("dma port shouldn't be used for pio access."); M5_DUMMY_RETURN
144 }
135 virtual void recvFunctional(PacketPtr pkt)
145 virtual void recvFunctional(PacketPtr pkt)
136 { panic("dma port shouldn't be used for pio access."); }
146 {
147 if (recvSnoops) return;
137
148
149 panic("dma port shouldn't be used for pio access.");
150 }
151
138 virtual void recvStatusChange(Status status)
152 virtual void recvStatusChange(Status status)
139 { ; }
153 {
154 if (recvSnoops) {
155 if (status == RangeChange) {
156 if (!snoopRangeSent) {
157 snoopRangeSent = true;
158 sendStatusChange(Port::RangeChange);
159 }
160 return;
161 }
162 panic("Unexpected recvStatusChange\n");
163 }
164 }
140
141 virtual void recvRetry() ;
142
143 virtual void getDeviceAddressRanges(AddrRangeList &resp,
144 bool &snoop)
165
166 virtual void recvRetry() ;
167
168 virtual void getDeviceAddressRanges(AddrRangeList &resp,
169 bool &snoop)
145 { resp.clear(); snoop = false; }
170 { resp.clear(); snoop = recvSnoops; }
146
147 void queueDma(PacketPtr pkt, bool front = false);
148 void sendDma();
149
150 /** event to give us a kick every time we backoff time is reached. */
151 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
152
153 public:
171
172 void queueDma(PacketPtr pkt, bool front = false);
173 void sendDma();
174
175 /** event to give us a kick every time we backoff time is reached. */
176 EventWrapper<DmaPort, &DmaPort::sendDma> backoffEvent;
177
178 public:
154 DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff);
179 DmaPort(MemObject *dev, System *s, Tick min_backoff, Tick max_backoff,
180 bool recv_snoops = false);
155
156 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
157 uint8_t *data, Tick delay, Request::Flags flag = 0);
158
159 bool dmaPending() { return pendingCount > 0; }
160
161 unsigned cacheBlockSize() const { return peerBlockSize(); }
162 unsigned int drain(Event *de);

--- 123 unchanged lines hidden ---
181
182 void dmaAction(Packet::Command cmd, Addr addr, int size, Event *event,
183 uint8_t *data, Tick delay, Request::Flags flag = 0);
184
185 bool dmaPending() { return pendingCount > 0; }
186
187 unsigned cacheBlockSize() const { return peerBlockSize(); }
188 unsigned int drain(Event *de);

--- 123 unchanged lines hidden ---