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.
This commit is contained in:
@@ -342,7 +342,7 @@ IdeDisk::doDmaTransfer()
|
||||
panic("Inconsistent DMA transfer state: dmaState = %d devState = %d\n",
|
||||
dmaState, devState);
|
||||
|
||||
if (ctrl->dmaPending() || ctrl->getDrainState() != Drainable::Running) {
|
||||
if (ctrl->dmaPending() || ctrl->getDrainState() != DrainState::Running) {
|
||||
schedule(dmaTransferEvent, curTick() + DMA_BACKOFF_PERIOD);
|
||||
return;
|
||||
} else
|
||||
@@ -436,7 +436,7 @@ IdeDisk::doDmaRead()
|
||||
curPrd.getByteCount(), TheISA::PageBytes);
|
||||
|
||||
}
|
||||
if (ctrl->dmaPending() || ctrl->getDrainState() != Drainable::Running) {
|
||||
if (ctrl->dmaPending() || ctrl->getDrainState() != DrainState::Running) {
|
||||
schedule(dmaReadWaitEvent, curTick() + DMA_BACKOFF_PERIOD);
|
||||
return;
|
||||
} else if (!dmaReadCG->done()) {
|
||||
@@ -518,7 +518,7 @@ IdeDisk::doDmaWrite()
|
||||
dmaWriteCG = new ChunkGenerator(curPrd.getBaseAddr(),
|
||||
curPrd.getByteCount(), TheISA::PageBytes);
|
||||
}
|
||||
if (ctrl->dmaPending() || ctrl->getDrainState() != Drainable::Running) {
|
||||
if (ctrl->dmaPending() || ctrl->getDrainState() != DrainState::Running) {
|
||||
schedule(dmaWriteWaitEvent, curTick() + DMA_BACKOFF_PERIOD);
|
||||
DPRINTF(IdeDisk, "doDmaWrite: rescheduling\n");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user