2c2
< * Copyright (c) 2011-2012,2016 ARM Limited
---
> * Copyright (c) 2011-2012,2016-2017 ARM Limited
139c139,141
< syscallRetryLatency(p->syscallRetryLatency)
---
> syscallRetryLatency(p->syscallRetryLatency),
> pwrGatingLatency(p->pwr_gating_latency),
> enterPwrGatingEvent([this]{ enterPwrGating(); }, name())
363a366,368
> if (_switchedOut)
> ClockedObject::pwrState(Enums::PwrState::OFF);
>
474a480,486
> void
> BaseCPU::deschedulePowerGatingEvent()
> {
> if (enterPwrGatingEvent.scheduled()){
> deschedule(enterPwrGatingEvent);
> }
> }
475a488,503
> void
> BaseCPU::schedulePowerGatingEvent()
> {
> for (auto tc : threadContexts) {
> if (tc->status() == ThreadContext::Active)
> return;
> }
>
> if (ClockedObject::pwrState() == Enums::PwrState::CLK_GATED) {
> assert(!enterPwrGatingEvent.scheduled());
> // Schedule a power gating event when clock gated for the specified
> // amount of time
> schedule(enterPwrGatingEvent, clockEdge(pwrGatingLatency));
> }
> }
>
489a518,521
> // Squash enter power gating event while cpu gets activated
> if (enterPwrGatingEvent.scheduled())
> deschedule(enterPwrGatingEvent);
>
505a538,540
>
> //Schedule power gating event when clock gated for a configurable cycles
> schedule(enterPwrGatingEvent, clockEdge(pwrGatingLatency));
508a544,549
> BaseCPU::enterPwrGating(void)
> {
> ClockedObject::pwrState(Enums::PwrState::OFF);
> }
>
> void
518a560,562
>
> // Go to the power gating state
> ClockedObject::pwrState(Enums::PwrState::OFF);
529a574,575
> // Take over the power state of the switchedOut CPU
> ClockedObject::pwrState(oldCPU->pwrState());