aboutsummaryrefslogtreecommitdiff
path: root/src/include/bootstate.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2013-05-06 10:50:19 -0500
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-05-07 20:07:42 +0200
commit0748d305545440ae89034542ea761d39b9aab526 (patch)
tree315676c4dd69005995df88fce06fe8e80d672b14 /src/include/bootstate.h
parent39ecc65158f57af5889c957bba4209e8fa59c0bf (diff)
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); Change-Id: Ieb37050ff652fd85a6b1e0e2f81a1a2807bab8e0 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/3204 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/include/bootstate.h')
-rw-r--r--src/include/bootstate.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/bootstate.h b/src/include/bootstate.h
index f732d1e1a2..0370c36067 100644
--- a/src/include/bootstate.h
+++ b/src/include/bootstate.h
@@ -156,6 +156,14 @@ int boot_state_sched_on_entry(struct boot_state_callback *bscb,
int boot_state_sched_on_exit(struct boot_state_callback *bscb,
boot_state_t state);
+/* Block/Unblock the (state, seq) pair from transitioning. Returns 0 on
+ * success < 0 when the phase of the (state,seq) has already ran. */
+int boot_state_block(boot_state_t state, boot_state_sequence_t seq);
+int boot_state_unblock(boot_state_t state, boot_state_sequence_t seq);
+/* Block/Unblock current state phase from transitioning. */
+void boot_state_current_block(void);
+void boot_state_current_unblock(void);
+
/* Entry into the boot state machine. */
void hardwaremain(int boot_complete);