dma_device.hh (12087:0e082672ac6b) dma_device.hh (12131:9412371484f9)
1/*
2 * Copyright (c) 2012-2013, 2015, 2017 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

235 process();
236 // Need to notify DrainManager that this object is finished
237 // draining, even though it is immediately deleted.
238 signalDrainDone();
239 delete this;
240 }
241 }
242
1/*
2 * Copyright (c) 2012-2013, 2015, 2017 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

235 process();
236 // Need to notify DrainManager that this object is finished
237 // draining, even though it is immediately deleted.
238 signalDrainDone();
239 delete this;
240 }
241 }
242
243 /**
244 * Event invoked by DmaDevice on completion of each chunk.
245 */
246 class DmaChunkEvent : public Event
247 {
248 private:
249 DmaCallback *callback;
250
251 public:
252 DmaChunkEvent(DmaCallback *cb)
253 : Event(Default_Pri, AutoDelete), callback(cb)
254 { }
255
256 void process() { callback->chunkComplete(); }
257 };
258
259 public:
260
261 /**
262 * Request a chunk event. Chunks events should be provided to each DMA
263 * request that wishes to participate in this DmaCallback.
264 */
265 Event *getChunkEvent()
266 {
267 ++count;
243 public:
244
245 /**
246 * Request a chunk event. Chunks events should be provided to each DMA
247 * request that wishes to participate in this DmaCallback.
248 */
249 Event *getChunkEvent()
250 {
251 ++count;
268 return new DmaChunkEvent(this);
252 return new EventFunctionWrapper([this]{ chunkComplete(); }, name(),
253 true);
269 }
270};
271
272/**
273 * Buffered DMA engine helper class
274 *
275 * This class implements a simple DMA engine that feeds a FIFO
276 * buffer. The size of the buffer, the maximum number of pending

--- 240 unchanged lines hidden ---
254 }
255};
256
257/**
258 * Buffered DMA engine helper class
259 *
260 * This class implements a simple DMA engine that feeds a FIFO
261 * buffer. The size of the buffer, the maximum number of pending

--- 240 unchanged lines hidden ---