From c1bb2cd0b6a3d1b152be3686601234b3a363772b Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 10 Apr 2014 20:01:34 -0600 Subject: main: Hide the hush/simple details inside cli.c Move these details from main (which doesn't care which parser is used) to cli.c where they belong. Signed-off-by: Simon Glass --- common/cli.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'common/cli.c') diff --git a/common/cli.c b/common/cli.c index 9cf7ba1bd7..4ac9b3f017 100644 --- a/common/cli.c +++ b/common/cli.c @@ -104,3 +104,25 @@ int do_run(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 0; } #endif + +void cli_loop(void) +{ +#ifdef CONFIG_SYS_HUSH_PARSER + parse_file_outer(); + /* This point is never reached */ + for (;;); +#else + cli_simple_loop(); +#endif /*CONFIG_SYS_HUSH_PARSER*/ +} + +void cli_init(void) +{ +#ifdef CONFIG_SYS_HUSH_PARSER + u_boot_hush_start(); +#endif + +#if defined(CONFIG_HUSH_INIT_VAR) + hush_init_var(); +#endif +} -- cgit v1.2.3