Sean Wilson has uploaded this change for review. (
https://gem5-review.googlesource.com/3749
Change subject: sim, x86: Replace EventWrapper use with EventFunctionWrapper
......................................................................
sim, x86: Replace EventWrapper use with EventFunctionWrapper
Change-Id: Ie1df07b70776208fc3631a73d403024636fc05a9
Signed-off-by: Sean Wilson <[email protected]>
---
M src/arch/x86/pagetable_walker.hh
M src/sim/power/thermal_model.cc
M src/sim/power/thermal_model.hh
M src/sim/root.cc
M src/sim/root.hh
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/arch/x86/pagetable_walker.hh
b/src/arch/x86/pagetable_walker.hh
index 9be35e6..d71db7e 100644
--- a/src/arch/x86/pagetable_walker.hh
+++ b/src/arch/x86/pagetable_walker.hh
@@ -178,7 +178,7 @@
/**
* Event used to call startWalkWrapper.
**/
- EventWrapper<Walker, &Walker::startWalkWrapper>
startWalkWrapperEvent;
+ EventFunctionWrapper startWalkWrapperEvent;
// Functions for dealing with packets.
bool recvTimingResp(PacketPtr pkt);
@@ -205,7 +205,7 @@
funcState(this, NULL, NULL, true), tlb(NULL),
sys(params->system),
masterId(sys->getMasterId(name())),
numSquashable(params->num_squash_per_cycle),
- startWalkWrapperEvent(this)
+ startWalkWrapperEvent([this]{ startWalkWrapper(); }, name())
{
}
};
diff --git a/src/sim/power/thermal_model.cc b/src/sim/power/thermal_model.cc
index 05ce42b..d362da6 100644
--- a/src/sim/power/thermal_model.cc
+++ b/src/sim/power/thermal_model.cc
@@ -194,7 +194,7 @@
* ThermalModel
*/
ThermalModel::ThermalModel(const Params *p)
- : ClockedObject(p), stepEvent(this), _step(p->step)
+ : ClockedObject(p), stepEvent([this]{ doStep(); }, name()),
_step(p->step)
{
}
diff --git a/src/sim/power/thermal_model.hh b/src/sim/power/thermal_model.hh
index 7ee4ffd..b47061d 100644
--- a/src/sim/power/thermal_model.hh
+++ b/src/sim/power/thermal_model.hh
@@ -179,7 +179,7 @@
std::vector <ThermalNode*> eq_nodes;
/** Stepping event to update the model values */
- EventWrapper<ThermalModel, &ThermalModel::doStep> stepEvent;
+ EventFunctionWrapper stepEvent;
/** Step in seconds for thermal updates */
double _step;
diff --git a/src/sim/root.cc b/src/sim/root.cc
index 752632b..f4aabad 100644
--- a/src/sim/root.cc
+++ b/src/sim/root.cc
@@ -104,8 +104,9 @@
timeSyncEnable(en);
}
-Root::Root(RootParams *p) : SimObject(p), _enabled(false),
- _periodTick(p->time_sync_period), syncEvent(this)
+Root::Root(RootParams *p)
+ : SimObject(p), _enabled(false), _periodTick(p->time_sync_period),
+ syncEvent([this]{ timeSync(); }, name())
{
_period.setTick(p->time_sync_period);
_spinThreshold.setTick(p->time_sync_spin_threshold);
diff --git a/src/sim/root.hh b/src/sim/root.hh
index 7273a07..db207a7 100644
--- a/src/sim/root.hh
+++ b/src/sim/root.hh
@@ -60,8 +60,7 @@
Time lastTime;
void timeSync();
- EventWrapper<Root, &Root::timeSync> syncEvent;
- friend class EventWrapper<Root, &Root::timeSync>;
+ EventFunctionWrapper syncEvent;
public:
/**
--
To view, visit https://gem5-review.googlesource.com/3749
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1df07b70776208fc3631a73d403024636fc05a9
Gerrit-Change-Number: 3749
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Wilson <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev