Procházet zdrojové kódy

common: Move command functions out of common.h

Move these functions into the command.h header file which is a better fit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass před 4 roky
rodič
revize
288b29e44d

+ 1 - 0
arch/arm/mach-kirkwood/cpu.c

@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <env.h>
 #include <netdev.h>
 #include <asm/cache.h>

+ 1 - 0
arch/sandbox/cpu/start.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <errno.h>
 #include <os.h>
 #include <cli.h>

+ 1 - 0
board/engicam/common/board.c

@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <env.h>
 #include <mmc.h>
 #include <asm/arch/sys_proto.h>

+ 1 - 0
board/gdsys/a38x/keyprogram.c

@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <env.h>
 #include <tpm-v1.h>
 #include <malloc.h>

+ 1 - 0
board/gdsys/p1022/controlcenterd-id.c

@@ -11,6 +11,7 @@
 #endif
 
 #include <common.h>
+#include <command.h>
 #include <dm.h>
 #include <env.h>
 #include <malloc.h>

+ 1 - 0
board/grinn/liteboard/board.c

@@ -4,6 +4,7 @@
  * Copyright (C) 2016 Grinn
  */
 
+#include <command.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/imx-regs.h>

+ 1 - 0
board/inversepath/usbarmory/usbarmory.c

@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <asm/io.h>
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/sys_proto.h>

+ 1 - 0
board/samsung/common/misc.c

@@ -5,6 +5,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <env.h>
 #include <lcd.h>
 #include <libtizen.h>

+ 1 - 0
common/autoboot.c

@@ -8,6 +8,7 @@
 #include <autoboot.h>
 #include <bootretry.h>
 #include <cli.h>
+#include <command.h>
 #include <console.h>
 #include <env.h>
 #include <fdtdec.h>

+ 1 - 0
common/cli.c

@@ -11,6 +11,7 @@
 #include <common.h>
 #include <cli.h>
 #include <cli_hush.h>
+#include <command.h>
 #include <console.h>
 #include <env.h>
 #include <fdtdec.h>

+ 1 - 0
common/cli_simple.c

@@ -11,6 +11,7 @@
 #include <common.h>
 #include <bootretry.h>
 #include <cli.h>
+#include <command.h>
 #include <console.h>
 #include <env.h>
 #include <linux/ctype.h>

+ 1 - 0
common/main.c

@@ -9,6 +9,7 @@
 #include <common.h>
 #include <autoboot.h>
 #include <cli.h>
+#include <command.h>
 #include <console.h>
 #include <env.h>
 #include <version.h>

+ 1 - 0
common/splash_source.c

@@ -7,6 +7,7 @@
 
 #include <common.h>
 #include <bmp_layout.h>
+#include <command.h>
 #include <env.h>
 #include <errno.h>
 #include <fs.h>

+ 1 - 0
drivers/fastboot/fb_command.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <env.h>
 #include <fastboot.h>
 #include <fastboot-internal.h>

+ 1 - 0
drivers/fastboot/fb_common.c

@@ -11,6 +11,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <env.h>
 #include <fastboot.h>
 #include <net/fastboot.h>

+ 1 - 0
drivers/mtd/nand/raw/fsl_elbc_nand.c

@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <malloc.h>
 #include <nand.h>
 

+ 1 - 0
drivers/mtd/nand/raw/fsl_ifc_nand.c

@@ -7,6 +7,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <malloc.h>
 #include <nand.h>
 

+ 1 - 0
drivers/net/fsl-mc/mc.c

@@ -5,6 +5,7 @@
  * Copyright 2017-2018 NXP
  */
 #include <common.h>
+#include <command.h>
 #include <cpu_func.h>
 #include <env.h>
 #include <errno.h>

+ 1 - 0
drivers/usb/gadget/f_thor.c

@@ -14,6 +14,7 @@
  * Sanghee Kim <sh0130.kim@samsung.com>
  */
 
+#include <command.h>
 #include <errno.h>
 #include <common.h>
 #include <console.h>

+ 16 - 0
include/command.h

@@ -199,6 +199,22 @@ void fixup_cmdtable(cmd_tbl_t *cmdtp, int size);
  * @return 0 if OK, 1 for error
  */
 int board_run_command(const char *cmdline);
+
+int run_command(const char *cmd, int flag);
+int run_command_repeatable(const char *cmd, int flag);
+
+/**
+ * Run a list of commands separated by ; or even \0
+ *
+ * Note that if 'len' is not -1, then the command does not need to be nul
+ * terminated, Memory will be allocated for the command in that case.
+ *
+ * @param cmd	List of commands to run, each separated bu semicolon
+ * @param len	Length of commands excluding terminator if known (-1 if not)
+ * @param flag	Execution flags (CMD_FLAG_...)
+ * @return 0 on success, or != 0 on error.
+ */
+int run_command_list(const char *cmd, int len, int flag);
 #endif	/* __ASSEMBLY__ */
 
 /*

+ 1 - 16
include/common.h

@@ -3,7 +3,7 @@
  * Common header file for U-Boot
  *
  * This file still includes quite a bit of stuff that should be in separate
- * headers like command.h. Please think before adding more things.
+ * headers. Please think before adding more things.
  * Patches to remove things are welcome.
  *
  * (C) Copyright 2000-2009
@@ -66,21 +66,6 @@ void	hang		(void) __attribute__ ((noreturn));
 
 /* common/main.c */
 void	main_loop	(void);
-int run_command(const char *cmd, int flag);
-int run_command_repeatable(const char *cmd, int flag);
-
-/**
- * Run a list of commands separated by ; or even \0
- *
- * Note that if 'len' is not -1, then the command does not need to be nul
- * terminated, Memory will be allocated for the command in that case.
- *
- * @param cmd	List of commands to run, each separated bu semicolon
- * @param len	Length of commands excluding terminator if known (-1 if not)
- * @param flag	Execution flags (CMD_FLAG_...)
- * @return 0 on success, or != 0 on error.
- */
-int run_command_list(const char *cmd, int len, int flag);
 
 int checkflash(void);
 int checkdram(void);

+ 1 - 0
test/command_ut.c

@@ -6,6 +6,7 @@
 #define DEBUG
 
 #include <common.h>
+#include <command.h>
 
 static const char test_cmd[] = "setenv list 1\n setenv list ${list}2; "
 		"setenv list ${list}3\0"

+ 1 - 0
test/dm/sf.c

@@ -4,6 +4,7 @@
  */
 
 #include <common.h>
+#include <command.h>
 #include <dm.h>
 #include <fdtdec.h>
 #include <mapmem.h>