BACKPORT: boot state: add ability to block state transitions
authorAaron Durbin <adurbin@chromium.org>
Mon, 6 May 2013 15:50:19 +0000 (10:50 -0500)
committerChromeBot <chrome-bot@google.com>
Wed, 8 May 2013 18:41:54 +0000 (11:41 -0700)
commitcbc47ea87f127641dfacc7f65faca5e174a683ec
treeadb095b01cc328a9dc2b6bf4b88747ad38dd7c73
parent35e088ba4a01f39884d88e75efc27221ca996f2f
BACKPORT: boot state: add ability to block state transitions

In order to properly sequence the boot state machine it's
important that outside code can block the transition from
one state to the next. When timers are not involved there's
no reason for any of the existing code to block a state
transition. However, if there is a timer callback that needs to
complete by a certain point in the boot sequence it is necessary
to place a block for the given state.

To that end, 4 new functions are added to provide the API for
blocking a state.
1. boot_state_block(boot_state_t state, boot_state_sequence_t seq);
2. boot_state_unblock(boot_state_t state, boot_state_sequence_t seq);
3. boot_state_current_block(void);
4. boot_state_current_unblock(void);

BUG=None
BRANCH=None
TEST=Compiled and booted

Change-Id: I3de15e5b91e7fd1c833bc99b0d0af46a5a7c4bee
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50455
Reviewed-by: Stefan Reinauer <reinauer@google.com>
src/include/bootstate.h
src/lib/hardwaremain.c