]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/main.c
arm: armv7: add compile option -mno-unaligned-access if available
[karo-tx-uboot.git] / common / main.c
index 6a3eac28aa7e280fbd8b6f508e5cd938c3e15375..a93335798bd0dd887f96da3f36f16ec2f42f812c 100644 (file)
@@ -973,7 +973,6 @@ int readline_into_buffer(const char *const prompt, char *buffer, int timeout)
 
 #ifdef CONFIG_SHOW_ACTIVITY
                while (!tstc()) {
-                       extern void show_activity(int arg);
                        show_activity(0);
                        WATCHDOG_RESET();
                }
@@ -1261,7 +1260,6 @@ static void process_macros (const char *input, char *output)
  */
 static int builtin_run_command(const char *cmd, int flag)
 {
-       cmd_tbl_t *cmdtp;
        char cmdbuf[CONFIG_SYS_CBSIZE]; /* working copy of cmd          */
        char *token;                    /* start of token in cmdbuf     */
        char *sep;                      /* end of token (separator) in cmdbuf */
@@ -1339,42 +1337,9 @@ static int builtin_run_command(const char *cmd, int flag)
                        continue;
                }
 
-               /* Look up command in command table */
-               if ((cmdtp = find_cmd(argv[0])) == NULL) {
-                       printf ("Unknown command '%s' - try 'help'\n", argv[0]);
-                       rc = -1;        /* give up after bad command */
-                       continue;
-               }
-
-               /* found - check max args */
-               if (argc > cmdtp->maxargs) {
-                       cmd_usage(cmdtp);
-                       rc = -1;
-                       continue;
-               }
-
-#if defined(CONFIG_CMD_BOOTD)
-               /* avoid "bootd" recursion */
-               if (cmdtp->cmd == do_bootd) {
-#ifdef DEBUG_PARSER
-                       printf ("[%s]\n", finaltoken);
-#endif
-                       if (flag & CMD_FLAG_BOOTD) {
-                               puts ("'bootd' recursion detected\n");
-                               rc = -1;
-                               continue;
-                       } else {
-                               flag |= CMD_FLAG_BOOTD;
-                       }
-               }
-#endif
-
-               /* OK - call function to do the command */
-               if (cmd_call(cmdtp, flag, argc, argv) != 0)
+               if (cmd_process(flag, argc, argv, &repeatable))
                        rc = -1;
 
-               repeatable &= cmdtp->repeatable;
-
                /* Did the user stop this? */
                if (had_ctrlc ())
                        return -1;      /* if stopped then not repeatable */
@@ -1416,7 +1381,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
        int i;
 
        if (argc < 2)
-               return cmd_usage(cmdtp);
+               return CMD_RET_USAGE;
 
        for (i=1; i<argc; ++i) {
                char *arg;