From e9c3d59aae58f8fcf77ce5cf4b985dc9e2a90de2 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 7 Jul 2015 09:51:04 +0100 Subject: sim: Make the drain state a global typed enum The drain state enum is currently a part of the Drainable interface. The same state machine will be used by the DrainManager to identify the global state of the simulator. Make the drain state a global typed enum to better cater for this usage scenario. --- src/dev/copy_engine.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/dev/copy_engine.cc') diff --git a/src/dev/copy_engine.cc b/src/dev/copy_engine.cc index 5506103b1..035f824fa 100644 --- a/src/dev/copy_engine.cc +++ b/src/dev/copy_engine.cc @@ -140,12 +140,12 @@ CopyEngine::CopyEngineChannel::recvCommand() cr.status.dma_transfer_status(0); nextState = DescriptorFetch; fetchAddress = cr.descChainAddr; - if (ce->getDrainState() == Drainable::Running) + if (ce->getDrainState() == DrainState::Running) fetchDescriptor(cr.descChainAddr); } else if (cr.command.append_dma()) { if (!busy) { nextState = AddressFetch; - if (ce->getDrainState() == Drainable::Running) + if (ce->getDrainState() == DrainState::Running) fetchNextAddr(lastDescriptorAddr); } else refreshNext = true; @@ -635,20 +635,20 @@ CopyEngine::CopyEngineChannel::fetchAddrComplete() bool CopyEngine::CopyEngineChannel::inDrain() { - if (ce->getDrainState() == Drainable::Draining) { + if (ce->getDrainState() == DrainState::Draining) { DPRINTF(Drain, "CopyEngine done draining, processing drain event\n"); assert(drainManager); drainManager->signalDrainDone(); drainManager = NULL; } - return ce->getDrainState() != Drainable::Running; + return ce->getDrainState() != DrainState::Running; } unsigned int CopyEngine::CopyEngineChannel::drain(DrainManager *dm) { - if (nextState == Idle || ce->getDrainState() != Drainable::Running) + if (nextState == Idle || ce->getDrainState() != DrainState::Running) return 0; unsigned int count = 1; count += cePort.drain(dm); @@ -667,9 +667,9 @@ CopyEngine::drain(DrainManager *dm) count += chan[x]->drain(dm); if (count) - setDrainState(Draining); + setDrainState(DrainState::Draining); else - setDrainState(Drained); + setDrainState(DrainState::Drained); DPRINTF(Drain, "CopyEngine not drained\n"); return count; -- cgit v1.2.3