aboutsummaryrefslogtreecommitdiff
path: root/common/cli.c
diff options
context:
space:
mode:
authorSimon Glass2014-04-10 20:01:34 -0600
committerTom Rini2014-05-29 17:51:42 -0400
commitc1bb2cd0b6a3d1b152be3686601234b3a363772b (patch)
tree3e9227a68f254ed1439c5091d00563860b0ce207 /common/cli.c
parent1364a0e48a64a29930a8b22620f420e8f4984cc7 (diff)
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 <sjg@chromium.org>
Diffstat (limited to 'common/cli.c')
-rw-r--r--common/cli.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/cli.c b/common/cli.c
index 9cf7ba1bd79..4ac9b3f017c 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
+}