numSquashable(p->num_squash_per_cycle),
pendingReqs(0),
pendingChangeTick(curTick()),
- doL1DescEvent(this), doL2DescEvent(this),
- doL0LongDescEvent(this), doL1LongDescEvent(this),
- doL2LongDescEvent(this), doL3LongDescEvent(this),
+ doL1DescEvent([this]{ doL1DescriptorWrapper(); }, name()),
+ doL2DescEvent([this]{ doL2DescriptorWrapper(); }, name()),
+ doL0LongDescEvent([this]{ doL0LongDescriptorWrapper(); }, name()),
+ doL1LongDescEvent([this]{ doL1LongDescriptorWrapper(); }, name()),
+ doL2LongDescEvent([this]{ doL2LongDescriptorWrapper(); }, name()),
+ doL3LongDescEvent([this]{ doL3LongDescriptorWrapper(); }, name()),
LongDescEventByLevel { &doL0LongDescEvent, &doL1LongDescEvent,
&doL2LongDescEvent, &doL3LongDescEvent },
- doProcessEvent(this)
+ doProcessEvent([this]{ processWalkWrapper(); }, name())
{
sctlr = 0;
void doL1Descriptor();
void doL1DescriptorWrapper();
- EventWrapper<TableWalker,
- &TableWalker::doL1DescriptorWrapper> doL1DescEvent;
+ EventFunctionWrapper doL1DescEvent;
void doL2Descriptor();
void doL2DescriptorWrapper();
- EventWrapper<TableWalker,
- &TableWalker::doL2DescriptorWrapper> doL2DescEvent;
+ EventFunctionWrapper doL2DescEvent;
void doLongDescriptor();
void doL0LongDescriptorWrapper();
- EventWrapper<TableWalker,
- &TableWalker::doL0LongDescriptorWrapper> doL0LongDescEvent;
+ EventFunctionWrapper doL0LongDescEvent;
void doL1LongDescriptorWrapper();
- EventWrapper<TableWalker,
- &TableWalker::doL1LongDescriptorWrapper> doL1LongDescEvent;
+ EventFunctionWrapper doL1LongDescEvent;
void doL2LongDescriptorWrapper();
- EventWrapper<TableWalker,
- &TableWalker::doL2LongDescriptorWrapper> doL2LongDescEvent;
+ EventFunctionWrapper doL2LongDescEvent;
void doL3LongDescriptorWrapper();
- EventWrapper<TableWalker,
- &TableWalker::doL3LongDescriptorWrapper> doL3LongDescEvent;
+ EventFunctionWrapper doL3LongDescEvent;
void doLongDescriptorWrapper(LookupLevel curr_lookup_level);
Event* LongDescEventByLevel[4];
static bool checkAddrSizeFaultAArch64(Addr addr, int currPhysAddrRange);
Fault processWalkAArch64();
void processWalkWrapper();
- EventWrapper<TableWalker, &TableWalker::processWalkWrapper> doProcessEvent;
+ EventFunctionWrapper doProcessEvent;
void nextWalk(ThreadContext *tc);
domainIDIndexToRead(0),
perfLevelAck(0),
perfLevelToRead(0),
- updateAckEvent(this)
+ updateAckEvent([this]{ updatePLAck(); }, name())
{
fatal_if(!p->dvfs_handler, "EnergyCtrl: Needs a DVFSHandler for a "
"functioning system.\n");
perfLevelAck = 1;
}
- EventWrapper<EnergyCtrl, &EnergyCtrl::updatePLAck> updateAckEvent;
+ EventFunctionWrapper updateAckEvent;
};
#endif //__DEV_ARM_ENERGY_CTRL_HH__
blocksPerDisk(0),
planeMask(numPlanes - 1),
planeEventQueue(numPlanes),
- planeEvent(this)
+ planeEvent([this]{ actionComplete(); }, name())
{
/*
std::vector<std::deque<struct CallBackEntry> > planeEventQueue;
/** Completion event */
- EventWrapper<FlashDevice, &FlashDevice::actionComplete> planeEvent;
+ EventFunctionWrapper planeEvent;
};
#endif //__DEV_ARM_FLASH_DEVICE_HH__
: _name(name), _parent(parent), _systemCounter(sysctr),
_interrupt(interrupt),
_control(0), _counterLimit(0), _offset(0),
- _counterLimitReachedEvent(this)
+ _counterLimitReachedEvent([this]{ counterLimitReached(); }, name)
{
}
/// Called when the upcounter reaches the programmed value.
void counterLimitReached();
- EventWrapper<ArchTimer, &ArchTimer::counterLimitReached>
- _counterLimitReachedEvent;
+ EventFunctionWrapper _counterLimitReachedEvent;
public:
ArchTimer(const std::string &name,
pixel_format(0),
red_select(0), green_select(0), blue_select(0),
- virtRefreshEvent(this),
+ virtRefreshEvent([this]{ virtRefresh(); }, name()),
// Other
bmp(&pixelPump.fb), pic(NULL), conv(PixelConverter::rgba8888_le),
pixelPump(*this, *p->pxl_clk, p->pixel_chunk)
/** Handler for fast frame refresh in KVM-mode */
void virtRefresh();
- EventWrapper<HDLcd, &HDLcd::virtRefresh> virtRefreshEvent;
+ EventFunctionWrapper virtRefreshEvent;
/** Helper to write out bitmaps */
Bitmap bmp;
Pl050::Pl050(const Params *p)
: AmbaIntDevice(p, 0xfff), control(0), status(0x43), clkdiv(0),
rawInterrupts(0), ackNext(false), shiftDown(false),
- vnc(p->vnc), driverInitialized(false), intEvent(this)
+ vnc(p->vnc), driverInitialized(false),
+ intEvent([this]{ generateInterrupt(); }, name())
{
if (vnc) {
if (!p->is_mouse)
return tmp_interrupt;
}
/** Wrapper to create an event out of the thing */
- EventWrapper<Pl050, &Pl050::generateInterrupt> intEvent;
+ EventFunctionWrapper intEvent;
/** Receive queue. This list contains all the pending commands that
* need to be sent to the driver
Pl011::Pl011(const Pl011Params *p)
: Uart(p, 0xfff),
- intEvent(this),
+ intEvent([this]{ generateInterrupt(); }, name()),
control(0x300), fbrd(0), ibrd(0), lcrh(0), ifls(0x12),
imsc(0), rawInt(0),
gic(p->gic), endOnEOT(p->end_on_eot), intNum(p->int_num),
inline uint16_t maskInt() const { return rawInt & imsc; }
/** Wrapper to create an event out of the thing */
- EventWrapper<Pl011, &Pl011::generateInterrupt> intEvent;
+ EventFunctionWrapper intEvent;
protected: // Registers
static const uint64_t AMBA_ID = ULL(0xb105f00d00341011);
vnc(p->vnc), bmp(&fb), pic(NULL),
width(LcdMaxWidth), height(LcdMaxHeight),
bytesPerPixel(4), startTime(0), startAddr(0), maxAddr(0), curAddr(0),
- waterMark(0), dmaPendingNum(0), readEvent(this), fillFifoEvent(this),
+ waterMark(0), dmaPendingNum(0),
+ readEvent([this]{ readFramebuffer(); }, name()),
+ fillFifoEvent([this]{ fillFifo(); }, name()),
dmaDoneEventAll(maxOutstandingDma, this),
dmaDoneEventFree(maxOutstandingDma),
- intEvent(this), enableCapture(p->enable_capture)
+ intEvent([this]{ generateInterrupt(); }, name()),
+ enableCapture(p->enable_capture)
{
pioSize = 0xFFFF;
void dmaDone();
/** DMA framebuffer read event */
- EventWrapper<Pl111, &Pl111::readFramebuffer> readEvent;
+ EventFunctionWrapper readEvent;
/** Fill fifo */
- EventWrapper<Pl111, &Pl111::fillFifo> fillFifoEvent;
+ EventFunctionWrapper fillFifoEvent;
/**@{*/
/**
/**@}*/
/** Wrapper to create an event out of the interrupt */
- EventWrapper<Pl111, &Pl111::generateInterrupt> intEvent;
+ EventFunctionWrapper intEvent;
bool enableCapture;
PL031::PL031(Params *p)
: AmbaIntDevice(p, 0xfff), timeVal(mkutctime(&p->time)),
lastWrittenTick(0), loadVal(0), matchVal(0),
- rawInt(false), maskInt(false), pendingInt(false), matchEvent(this)
+ rawInt(false), maskInt(false), pendingInt(false),
+ matchEvent([this]{ counterMatch(); }, name())
{
}
/** Called when the counter reaches matches */
void counterMatch();
- EventWrapper<PL031, &PL031::counterMatch> matchEvent;
+ EventFunctionWrapper matchEvent;
/** Called to update the matchEvent when the load Value or match value are
* written.
CpuLocalTimer::Timer::Timer()
: timerControl(0x0), watchdogControl(0x0), rawIntTimer(false), rawIntWatchdog(false),
rawResetWatchdog(false), watchdogDisableReg(0x0), pendingIntTimer(false), pendingIntWatchdog(false),
- timerLoadValue(0x0), watchdogLoadValue(0x0), timerZeroEvent(this), watchdogZeroEvent(this)
+ timerLoadValue(0x0), watchdogLoadValue(0x0),
+ timerZeroEvent([this]{ timerAtZero(); }, name()),
+ watchdogZeroEvent([this]{ watchdogAtZero(); }, name())
{
}
/** Called when the counter reaches 0 */
void timerAtZero();
- EventWrapper<Timer, &Timer::timerAtZero> timerZeroEvent;
+ EventFunctionWrapper timerZeroEvent;
void watchdogAtZero();
- EventWrapper<Timer, &Timer::watchdogAtZero> watchdogZeroEvent;
+ EventFunctionWrapper watchdogZeroEvent;
public:
/** Restart the counter ticking at val
* @param val the value to start at */
Sp804::Timer::Timer(std::string __name, Sp804 *_parent, int int_num, Tick _clock)
: _name(__name), parent(_parent), intNum(int_num), clock(_clock), control(0x20),
- rawInt(false), pendingInt(false), loadValue(0xffffffff), zeroEvent(this)
+ rawInt(false), pendingInt(false), loadValue(0xffffffff),
+ zeroEvent([this]{ counterAtZero(); }, name())
{
}
/** Called when the counter reaches 0 */
void counterAtZero();
- EventWrapper<Timer, &Timer::counterAtZero> zeroEvent;
+ EventFunctionWrapper zeroEvent;
public:
/** Restart the counter ticking at val
< curTick()))
writeDoneEvent.pop_front();
- writeDoneEvent.push_back(this);
+ writeDoneEvent.push_back(
+ EventFunctionWrapper([this]{ writeDone(); },
+ name()));
assert(!writeDoneEvent.back().scheduled());
/**destination is an offset here since we are writing to a disk*/
/** check wether interrupt is needed */
if (lastTransfer) {
++readPendingNum;
- readDoneEvent.push_back(this);
+ readDoneEvent.push_back(
+ EventFunctionWrapper([this]{ readDone(); },
+ name()));
assert(!readDoneEvent.back().scheduled());
dmaPort.dmaAction(MemCmd::WriteReq, start, size,
&readDoneEvent.back(), destination, 0);
* because the flow of the events is completely in the control of these
* classes. (Whereas in the DMA case we rely on an external class)
*/
- std::deque<EventWrapper<UFSHostDevice, &UFSHostDevice::readDone> >
- readDoneEvent;
- std::deque<EventWrapper<UFSHostDevice, &UFSHostDevice::writeDone> >
- writeDoneEvent;
+ std::deque<EventFunctionWrapper> readDoneEvent;
+ std::deque<EventFunctionWrapper> writeDoneEvent;
/**
* Callbacks for the logic units. One to indicate the completion of a