summaryrefslogtreecommitdiff
path: root/include/autoboot.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-04-10 20:01:35 -0600
committerTom Rini <trini@ti.com>2014-05-29 17:52:03 -0400
commitaffb215626f91e717088a27081d24c473895d47d (patch)
tree9ced673b20b48fb9a70253860e5cc6b7d9c79a29 /include/autoboot.h
parentc1bb2cd0b6a3d1b152be3686601234b3a363772b (diff)
downloadu-boot-imx-affb215626f91e717088a27081d24c473895d47d.zip
u-boot-imx-affb215626f91e717088a27081d24c473895d47d.tar.gz
u-boot-imx-affb215626f91e717088a27081d24c473895d47d.tar.bz2
main: Make the execution path a little clearer in main.c
bootdelay_process() never returns in some circumstances, whichs makes the control flow confusing. Change it so that the decision about how to execute the boot command is made in the main_loop() code, so it is easier to follow. Move CLI stuff to cli.c. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/autoboot.h')
-rw-r--r--include/autoboot.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/include/autoboot.h b/include/autoboot.h
index aaae4af..3a9059a 100644
--- a/include/autoboot.h
+++ b/include/autoboot.h
@@ -13,9 +13,33 @@
#define __AUTOBOOT_H
#ifdef CONFIG_BOOTDELAY
-void bootdelay_process(void);
+/**
+ * bootdelay_process() - process the bootd delay
+ *
+ * Process the boot delay, boot limit, then get the value of either
+ * bootcmd, failbootcmd or altbootcmd depending on the current state.
+ * Return this command so it can be executed.
+ *
+ * @return command to executed
+ */
+const char *bootdelay_process(void);
+
+/**
+ * autoboot_command() - run the autoboot command
+ *
+ * If enabled, run the autoboot command returned from bootdelay_process().
+ * Also do the CONFIG_MENUKEY processing if enabled.
+ *
+ * @cmd: Command to run
+ */
+void autoboot_command(const char *cmd);
#else
-static inline void bootdelay_process(void)
+static inline const char *bootdelay_process(void)
+{
+ return NULL;
+}
+
+static inline void autoboot_command(const char *s)
{
}
#endif