DMASequencer.cc (10910:32f3d1c454ec) DMASequencer.cc (10912:b99a6662d7c2)
1/*
2 * Copyright (c) 2008 Mark D. Hill and David A. Wood
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;

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

156 drainManager->signalDrainDone();
157 // Clear the drain manager once we're done with it.
158 drainManager = NULL;
159 }
160 }
161}
162
163unsigned int
1/*
2 * Copyright (c) 2008 Mark D. Hill and David A. Wood
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;

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

156 drainManager->signalDrainDone();
157 // Clear the drain manager once we're done with it.
158 drainManager = NULL;
159 }
160 }
161}
162
163unsigned int
164DMASequencer::getChildDrainCount(DrainManager *dm)
165{
166 int count = 0;
167 count += slave_port.drain(dm);
168 DPRINTF(Config, "count after slave port check %d\n", count);
169 return count;
170}
171
172unsigned int
173DMASequencer::drain(DrainManager *dm)
174{
175 if (isDeadlockEventScheduled()) {
176 descheduleDeadlockEvent();
177 }
178
179 // If the DMASequencer is not empty, then it needs to clear all outstanding
180 // requests before it should call drainManager->signalDrainDone()
181 DPRINTF(Config, "outstanding count %d\n", outstandingCount());
182 bool need_drain = outstandingCount() > 0;
183
164DMASequencer::drain(DrainManager *dm)
165{
166 if (isDeadlockEventScheduled()) {
167 descheduleDeadlockEvent();
168 }
169
170 // If the DMASequencer is not empty, then it needs to clear all outstanding
171 // requests before it should call drainManager->signalDrainDone()
172 DPRINTF(Config, "outstanding count %d\n", outstandingCount());
173 bool need_drain = outstandingCount() > 0;
174
184 //
185 // Also, get the number of child ports that will also need to clear
186 // their buffered requests before they call drainManager->signalDrainDone()
187 //
188 unsigned int child_drain_count = getChildDrainCount(dm);
189
190 // Set status
191 if (need_drain) {
192 drainManager = dm;
193
194 DPRINTF(Drain, "DMASequencer not drained\n");
195 setDrainState(DrainState::Draining);
175
176 // Set status
177 if (need_drain) {
178 drainManager = dm;
179
180 DPRINTF(Drain, "DMASequencer not drained\n");
181 setDrainState(DrainState::Draining);
196 return child_drain_count + 1;
182 return 1;
197 }
198
199 drainManager = NULL;
200 setDrainState(DrainState::Drained);
183 }
184
185 drainManager = NULL;
186 setDrainState(DrainState::Drained);
201 return child_drain_count;
187 return 0;
202}
203
204void
205DMASequencer::MemSlavePort::hitCallback(PacketPtr pkt)
206{
207 bool needsResponse = pkt->needsResponse();
208 assert(!pkt->isLLSC());
209 assert(!pkt->isFlush());

--- 160 unchanged lines hidden ---
188}
189
190void
191DMASequencer::MemSlavePort::hitCallback(PacketPtr pkt)
192{
193 bool needsResponse = pkt->needsResponse();
194 assert(!pkt->isLLSC());
195 assert(!pkt->isFlush());

--- 160 unchanged lines hidden ---