2c2
< * Copyright (c) 2012, 2015 ARM Limited
---
> * Copyright (c) 2012, 2015, 2017 ARM Limited
103a104,107
> panic_if(_state == DrainState::Resuming,
> "Resuming a system that is already trying to resume. This should "
> "never happen.\n");
>
108c112,129
< DPRINTF(Drain, "Resuming %u objects.\n", drainableCount());
---
> // At this point in time the DrainManager and all objects will be
> // in the the Drained state. New objects (i.e., objects created
> // while resuming) will inherit the Resuming state from the
> // DrainManager, which means we have to resume objects until all
> // objects are in the Running state.
> _state = DrainState::Resuming;
>
> do {
> DPRINTF(Drain, "Resuming %u objects.\n", drainableCount());
> for (auto *obj : _allDrainable) {
> if (obj->drainState() != DrainState::Running) {
> assert(obj->drainState() == DrainState::Drained ||
> obj->drainState() == DrainState::Resuming);
> obj->dmDrainResume();
> }
> }
> } while (!allInState(DrainState::Running));
>
110,111d130
< for (auto *obj : _allDrainable)
< obj->dmDrainResume();
156a176,186
> bool
> DrainManager::allInState(DrainState state) const
> {
> for (const auto *obj : _allDrainable) {
> if (obj->drainState() != state)
> return false;
> }
>
> return true;
> }
>
192c222,223
< panic_if(_drainState != DrainState::Drained,
---
> panic_if(_drainState != DrainState::Drained &&
> _drainState != DrainState::Resuming,