diff options
author | Sean Wilson <spwilson2@wisc.edu> | 2017-06-07 16:32:15 -0500 |
---|---|---|
committer | Sean Wilson <spwilson2@wisc.edu> | 2017-06-20 18:03:21 +0000 |
commit | c8668a663992264911545f8001d462e0885b114c (patch) | |
tree | b91e2fd0b64f01f4606b4d3c9efae91623276652 /src/dev/net/sinic.cc | |
parent | 475f613f2661f3be5f7479c5c7229e5adcb74d93 (diff) | |
download | gem5-c8668a663992264911545f8001d462e0885b114c.tar.xz |
dev: Replace EventWrapper use with EventFunctionWrapper
Change-Id: I6b03cc6f67e76dffb79940431711ae6171901c6a
Signed-off-by: Sean Wilson <spwilson2@wisc.edu>
Reviewed-on: https://gem5-review.googlesource.com/3748
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/dev/net/sinic.cc')
-rw-r--r-- | src/dev/net/sinic.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dev/net/sinic.cc b/src/dev/net/sinic.cc index e86e1abe2..50341a4d3 100644 --- a/src/dev/net/sinic.cc +++ b/src/dev/net/sinic.cc @@ -91,7 +91,9 @@ Device::Device(const Params *p) virtualRegs(p->virtual_count < 1 ? 1 : p->virtual_count), rxFifo(p->rx_fifo_size), txFifo(p->tx_fifo_size), rxKickTick(0), txKickTick(0), - txEvent(this), rxDmaEvent(this), txDmaEvent(this), + txEvent([this]{ txEventTransmit(); }, name()), + rxDmaEvent([this]{ rxDmaDone(); }, name()), + txDmaEvent([this]{ txDmaDone(); }, name()), dmaReadDelay(p->dma_read_delay), dmaReadFactor(p->dma_read_factor), dmaWriteDelay(p->dma_write_delay), dmaWriteFactor(p->dma_write_factor) { @@ -535,7 +537,9 @@ Base::cpuIntrPost(Tick when) if (intrEvent) intrEvent->squash(); - intrEvent = new IntrEvent(this, true); + + intrEvent = new EventFunctionWrapper([this]{ cpuInterrupt(); }, + name(), true); schedule(intrEvent, intrTick); } @@ -1297,7 +1301,8 @@ Base::unserialize(CheckpointIn &cp) Tick intrEventTick; UNSERIALIZE_SCALAR(intrEventTick); if (intrEventTick) { - intrEvent = new IntrEvent(this, true); + intrEvent = new EventFunctionWrapper([this]{ cpuInterrupt(); }, + name(), true); schedule(intrEvent, intrEventTick); } } |