3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * Definitions for Command Processor
38 extern struct list_head command_list
;
40 #define for_each_command(cmd) list_for_each_entry(cmd, &command_list, list)
43 * Monitor Command Table
47 const char *name
; /* Command Name */
49 /* Implementation function */
50 int (*cmd
)(struct cmd_tbl_s
*, int, char *[]);
51 const char *usage
; /* Usage message (short) */
53 struct list_head list
; /* List of commands */
54 #ifdef CONFIG_LONGHELP
55 const char *help
; /* Help message (long) */
59 /* This is required because the linker will put symbols on a 64 bit alignment */
60 __attribute__((aligned(64)))
65 typedef struct cmd_tbl_s cmd_tbl_t
;
67 extern cmd_tbl_t __u_boot_cmd_start
;
68 extern cmd_tbl_t __u_boot_cmd_end
;
71 /* common/command.c */
72 cmd_tbl_t
*find_cmd(const char *cmd
);
73 int execute_command(int argc
, char **argv
);
74 void u_boot_cmd_usage(cmd_tbl_t
*cmdtp
);
76 #define COMMAND_SUCCESS 0
77 #define COMMAND_ERROR 1
78 #define COMMAND_ERROR_USAGE 2
80 #endif /* __ASSEMBLY__ */
83 * Configurable monitor commands definitions have been moved
84 * to include/cmd_confdefs.h
87 #define __stringify_1(x) #x
88 #define __stringify(x) __stringify_1(x)
91 #define Struct_Section __attribute__ ((unused,section (".u_boot_cmd")))
93 #define U_BOOT_CMD_START(_name) \
94 const cmd_tbl_t __u_boot_cmd_##_name \
95 __attribute__ ((unused,section (".u_boot_cmd_" __stringify(_name)))) = { \
98 #define U_BOOT_CMD_END \
101 #ifdef CONFIG_LONGHELP
102 #define U_BOOT_CMD_HELP(text) .help = text,
104 #define U_BOOT_CMD_HELP(text)
107 int register_command(cmd_tbl_t
*);
109 #endif /* __COMMAND_H */