diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-03 13:48:25 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-07-03 16:42:18 +0200 |
commit | 35266d7e583f1bcc519f710f9f455127a14f31e8 (patch) | |
tree | 651608c918b8efbcca1ff3110133a55851696a02 /include/common.h | |
parent | 815189dd4c8be39b9caae6c06a75a994f1956140 (diff) | |
download | barebox-35266d7e583f1bcc519f710f9f455127a14f31e8.tar.gz barebox-35266d7e583f1bcc519f710f9f455127a14f31e8.tar.xz |
startup: Factor out the autoboot counter to separate function
The autoboot countdown is part of the init function. This patch factors
out this code to a separate function to allow boards to call it at a
different time. Also boards can set the autoboot state manually in case
they have its own idea how to interrupt the autoboot process.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/common.h')
-rw-r--r-- | include/common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h index b1294978d7..08f79a54af 100644 --- a/include/common.h +++ b/include/common.h @@ -93,6 +93,16 @@ unsigned long long strtoull_suffix(const char *str, char **endp, int base); */ extern int (*barebox_main)(void); +enum autoboot_state { + AUTOBOOT_UNKNOWN, + AUTOBOOT_ABORT, + AUTOBOOT_MENU, + AUTOBOOT_BOOT, +}; + +void set_autoboot_state(enum autoboot_state autoboot); +enum autoboot_state do_autoboot_countdown(void); + void __noreturn start_barebox(void); void shutdown_barebox(void); |