vboot/ui: add screen stack functionality
Add a stack storing previous screen states. When the user clicks
"Back" or presses ESC, revert to the previous state.
In order to deal with the possibility of a UI cycle (repeatedly
selecting the same sequence of screens) which would eventually
use up all available memory, re-use existing target screen states
within the stack. In other words, when switching to a specific
screen which already exists in the stack, pop until that screen
is reached, rather than creating a duplicate stack entry.
TEST=make clean && make runtests
Signed-off-by: Joel Kitching <firstname.lastname@example.org>
Reviewed-by: Joel Kitching <email@example.com>
Reviewed-by: Yu-Ping Wu <firstname.lastname@example.org>
Tested-by: Joel Kitching <email@example.com>
Commit-Queue: Joel Kitching <firstname.lastname@example.org>
6 files changed