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:
@@ -601,10 +601,10 @@ FlashDevice::drain(DrainManager *dm)
|
||||
|
||||
if (count) {
|
||||
DPRINTF(Drain, "Flash device is draining...\n");
|
||||
setDrainState(Drainable::Draining);
|
||||
setDrainState(DrainState::Draining);
|
||||
} else {
|
||||
DPRINTF(Drain, "Flash device drained\n");
|
||||
setDrainState(Drainable::Drained);
|
||||
setDrainState(DrainState::Drained);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -2333,10 +2333,10 @@ UFSHostDevice::drain(DrainManager *dm)
|
||||
|
||||
if (count) {
|
||||
DPRINTF(UFSHostDevice, "UFSDevice is draining...\n");
|
||||
setDrainState(Drainable::Draining);
|
||||
setDrainState(DrainState::Draining);
|
||||
} else {
|
||||
DPRINTF(UFSHostDevice, "UFSDevice drained\n");
|
||||
setDrainState(Drainable::Drained);
|
||||
setDrainState(DrainState::Drained);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user