1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

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>
This commit is contained in:
Simon Glass
2014-04-10 20:01:35 -06:00
committed by Tom Rini
parent c1bb2cd0b6
commit affb215626
5 changed files with 145 additions and 75 deletions

View File

@@ -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