From 8bcf6a799d8bde90565fd42cf74ada0ec9fbc98f Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Wed, 28 Jun 2017 11:29:26 -0500 Subject: dev: Refactor some Event subclasses to lambdas Change-Id: I965d31ff8ad1658b03a902bf4244d7d0977b0466 Signed-off-by: Sean Wilson Reviewed-on: https://gem5-review.googlesource.com/3928 Maintainer: Andreas Sandberg Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg --- src/dev/dma_device.hh | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/dev/dma_device.hh') diff --git a/src/dev/dma_device.hh b/src/dev/dma_device.hh index f354d3859..0dc79df42 100644 --- a/src/dev/dma_device.hh +++ b/src/dev/dma_device.hh @@ -240,22 +240,6 @@ class DmaCallback : public Drainable } } - /** - * Event invoked by DmaDevice on completion of each chunk. - */ - class DmaChunkEvent : public Event - { - private: - DmaCallback *callback; - - public: - DmaChunkEvent(DmaCallback *cb) - : Event(Default_Pri, AutoDelete), callback(cb) - { } - - void process() { callback->chunkComplete(); } - }; - public: /** @@ -265,7 +249,8 @@ class DmaCallback : public Drainable Event *getChunkEvent() { ++count; - return new DmaChunkEvent(this); + return new EventFunctionWrapper([this]{ chunkComplete(); }, name(), + true); } }; -- cgit v1.2.3