From 85e1a9b8548ca2df406fd1ff56568a7ee1481aa0 Mon Sep 17 00:00:00 2001 From: Sean Wilson Date: Thu, 8 Jun 2017 11:35:45 -0500 Subject: sim, x86: Replace EventWrapper use with EventFunctionWrapper Change-Id: Ie1df07b70776208fc3631a73d403024636fc05a9 Signed-off-by: Sean Wilson Reviewed-on: https://gem5-review.googlesource.com/3749 Reviewed-by: Jason Lowe-Power Reviewed-by: Anthony Gutierrez Maintainer: Anthony Gutierrez --- src/arch/x86/pagetable_walker.hh | 4 ++-- src/sim/power/thermal_model.cc | 2 +- src/sim/power/thermal_model.hh | 2 +- src/sim/root.cc | 5 +++-- src/sim/root.hh | 3 +-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/arch/x86/pagetable_walker.hh b/src/arch/x86/pagetable_walker.hh index 9be35e6cc..d71db7ea3 100644 --- a/src/arch/x86/pagetable_walker.hh +++ b/src/arch/x86/pagetable_walker.hh @@ -178,7 +178,7 @@ namespace X86ISA /** * Event used to call startWalkWrapper. **/ - EventWrapper startWalkWrapperEvent; + EventFunctionWrapper startWalkWrapperEvent; // Functions for dealing with packets. bool recvTimingResp(PacketPtr pkt); @@ -205,7 +205,7 @@ namespace X86ISA 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 05ce42bc9..d362da680 100644 --- a/src/sim/power/thermal_model.cc +++ b/src/sim/power/thermal_model.cc @@ -194,7 +194,7 @@ ThermalCapacitor::getEquation(ThermalNode * n, unsigned nnodes, * 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 7ee4ffdc3..b47061dbf 100644 --- a/src/sim/power/thermal_model.hh +++ b/src/sim/power/thermal_model.hh @@ -179,7 +179,7 @@ class ThermalModel : public ClockedObject std::vector eq_nodes; /** Stepping event to update the model values */ - EventWrapper stepEvent; + EventFunctionWrapper stepEvent; /** Step in seconds for thermal updates */ double _step; diff --git a/src/sim/root.cc b/src/sim/root.cc index 752632b5e..f4aabad2e 100644 --- a/src/sim/root.cc +++ b/src/sim/root.cc @@ -104,8 +104,9 @@ Root::timeSyncSpinThreshold(Time newThreshold) 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 7273a077b..db207a77b 100644 --- a/src/sim/root.hh +++ b/src/sim/root.hh @@ -60,8 +60,7 @@ class Root : public SimObject Time lastTime; void timeSync(); - EventWrapper syncEvent; - friend class EventWrapper; + EventFunctionWrapper syncEvent; public: /** -- cgit v1.2.3