Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
[platform/kernel/u-boot.git] / include / command.h
index a2936ad..a8a153c 100644 (file)
@@ -27,6 +27,8 @@
 #ifndef __COMMAND_H
 #define __COMMAND_H
 
+#include <config.h>
+
 #ifndef NULL
 #define NULL   0
 #endif
@@ -43,7 +45,7 @@ struct cmd_tbl_s {
                                        /* Implementation function      */
        int             (*cmd)(struct cmd_tbl_s *, int, int, char *[]);
        char            *usage;         /* Usage message        (short) */
-#ifdef CFG_LONGHELP
+#ifdef CONFIG_SYS_LONGHELP
        char            *help;          /* Help  message        (long)  */
 #endif
 #ifdef CONFIG_AUTO_COMPLETE
@@ -60,6 +62,7 @@ extern cmd_tbl_t  __u_boot_cmd_end;
 
 /* common/command.c */
 cmd_tbl_t *find_cmd(const char *cmd);
+cmd_tbl_t *find_cmd_tbl (const char *cmd, cmd_tbl_t *table, int table_len);
 
 #ifdef CONFIG_AUTO_COMPLETE
 extern void install_auto_complete(void);
@@ -74,7 +77,16 @@ extern int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *
  * void function (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  */
 
-typedef        void    command_t (cmd_tbl_t *, int, int, char *[]);
+typedef        void    command_t (cmd_tbl_t *, int, int, char *[]);
+
+#if defined(CONFIG_CMD_MEMORY)         \
+    || defined(CONFIG_CMD_I2C)         \
+    || defined(CONFIG_CMD_ITEST)       \
+    || defined(CONFIG_CMD_PCI)         \
+    || defined(CONFIG_CMD_PORTIO)
+#define CMD_DATA_SIZE
+extern int cmd_get_data_size(char* arg, int default_size);
+#endif
 
 #endif /* __ASSEMBLY__ */
 
@@ -84,24 +96,24 @@ typedef     void    command_t (cmd_tbl_t *, int, int, char *[]);
 #define CMD_FLAG_REPEAT                0x0001  /* repeat last command          */
 #define CMD_FLAG_BOOTD         0x0002  /* command is from bootd        */
 
-/*
- * Configurable monitor commands definitions have been moved
- * to include/cmd_confdefs.h
- */
-
-
 #define Struct_Section  __attribute__ ((unused,section (".u_boot_cmd")))
 
-#ifdef  CFG_LONGHELP
+#ifdef  CONFIG_SYS_LONGHELP
 
 #define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
 cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage, help}
 
+#define U_BOOT_CMD_MKENT(name,maxargs,rep,cmd,usage,help) \
+{#name, maxargs, rep, cmd, usage, help}
+
 #else  /* no long help info */
 
 #define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
 cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage}
 
-#endif /* CFG_LONGHELP */
+#define U_BOOT_CMD_MKENT(name,maxargs,rep,cmd,usage,help) \
+{#name, maxargs, rep, cmd, usage}
+
+#endif /* CONFIG_SYS_LONGHELP */
 
 #endif /* __COMMAND_H */