blob: e900f97df336c73d1aa8c0bd0e5a53c45ee4060e [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
wdenk78f66222002-08-27 10:27:51 +00002/*
Detlev Zundel2dce5512009-03-25 17:27:52 +01003 * (C) Copyright 2000-2009
wdenk78f66222002-08-27 10:27:51 +00004 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
wdenk78f66222002-08-27 10:27:51 +00005 */
6
7/*
8 * Definitions for Command Processor
9 */
10#ifndef __COMMAND_H
11#define __COMMAND_H
12
Simon Glass9fb625c2019-08-01 09:46:51 -060013#include <env.h>
Marek Vasut6c7c9462012-10-12 10:27:04 +000014#include <linker_lists.h>
Stefan Roesef2302d42008-08-06 14:05:38 +020015
wdenk78f66222002-08-27 10:27:51 +000016#ifndef NULL
17#define NULL 0
18#endif
19
Peter Tyser2fb26042009-01-27 18:03:12 -060020/* Default to a width of 8 characters for help message command width */
21#ifndef CONFIG_SYS_HELP_CMD_WIDTH
Heinrich Schuchardt9eebaba2019-02-28 06:17:56 +010022#define CONFIG_SYS_HELP_CMD_WIDTH 10
Peter Tyser2fb26042009-01-27 18:03:12 -060023#endif
24
wdenk78f66222002-08-27 10:27:51 +000025#ifndef __ASSEMBLY__
26/*
27 * Monitor Command Table
28 */
29
Simon Glass09140112020-05-10 11:40:03 -060030struct cmd_tbl {
wdenk78f66222002-08-27 10:27:51 +000031 char *name; /* Command Name */
wdenk78f66222002-08-27 10:27:51 +000032 int maxargs; /* maximum number of arguments */
Boris Brezillon80a48dd2018-12-03 22:54:20 +010033 /*
34 * Same as ->cmd() except the command
35 * tells us if it can be repeated.
36 * Replaces the old ->repeatable field
37 * which was not able to make
38 * repeatable property different for
39 * the main command and sub-commands.
40 */
Simon Glass09140112020-05-10 11:40:03 -060041 int (*cmd_rep)(struct cmd_tbl *cmd, int flags, int argc,
42 char *const argv[], int *repeatable);
wdenk78f66222002-08-27 10:27:51 +000043 /* Implementation function */
Simon Glass09140112020-05-10 11:40:03 -060044 int (*cmd)(struct cmd_tbl *cmd, int flags, int argc,
45 char *const argv[]);
wdenk78f66222002-08-27 10:27:51 +000046 char *usage; /* Usage message (short) */
Jean-Christophe PLAGNIOL-VILLARD6d0f6bc2008-10-16 15:01:15 +020047#ifdef CONFIG_SYS_LONGHELP
wdenk78f66222002-08-27 10:27:51 +000048 char *help; /* Help message (long) */
49#endif
wdenk04a85b32004-04-15 18:22:41 +000050#ifdef CONFIG_AUTO_COMPLETE
51 /* do auto completion on the arguments */
Simon Glass09140112020-05-10 11:40:03 -060052 int (*complete)(int argc, char *const argv[],
53 char last_char, int maxv, char *cmdv[]);
wdenk04a85b32004-04-15 18:22:41 +000054#endif
wdenk78f66222002-08-27 10:27:51 +000055};
56
Igor Grinbergd09b1782011-11-07 01:13:59 +000057#if defined(CONFIG_CMD_RUN)
Simon Glass09140112020-05-10 11:40:03 -060058extern int do_run(struct cmd_tbl *cmdtp, int flag, int argc,
59 char *const argv[]);
Igor Grinbergd09b1782011-11-07 01:13:59 +000060#endif
wdenk78f66222002-08-27 10:27:51 +000061
62/* common/command.c */
Simon Glass09140112020-05-10 11:40:03 -060063int _do_help(struct cmd_tbl *cmd_start, int cmd_items, struct cmd_tbl *cmdtp,
64 int flag, int argc, char *const argv[]);
65struct cmd_tbl *find_cmd(const char *cmd);
66struct cmd_tbl *find_cmd_tbl(const char *cmd, struct cmd_tbl *table,
67 int table_len);
68int complete_subcmdv(struct cmd_tbl *cmdtp, int count, int argc,
69 char *const argv[], char last_char, int maxv,
Boris Brezillon6fb61442018-12-03 22:54:19 +010070 char *cmdv[]);
wdenk78f66222002-08-27 10:27:51 +000071
Simon Glass09140112020-05-10 11:40:03 -060072extern int cmd_usage(const struct cmd_tbl *cmdtp);
Peter Tyser62c3ae72009-01-27 18:03:10 -060073
Boris Brezillon80a48dd2018-12-03 22:54:20 +010074/* Dummy ->cmd and ->cmd_rep wrappers. */
Simon Glass09140112020-05-10 11:40:03 -060075int cmd_always_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
76 char *const argv[], int *repeatable);
77int cmd_never_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
78 char *const argv[], int *repeatable);
79int cmd_discard_repeatable(struct cmd_tbl *cmdtp, int flag, int argc,
80 char *const argv[]);
Boris Brezillon80a48dd2018-12-03 22:54:20 +010081
Simon Glass09140112020-05-10 11:40:03 -060082static inline bool cmd_is_repeatable(struct cmd_tbl *cmdtp)
Boris Brezillon80a48dd2018-12-03 22:54:20 +010083{
84 return cmdtp->cmd_rep == cmd_always_repeatable;
85}
86
wdenk04a85b32004-04-15 18:22:41 +000087#ifdef CONFIG_AUTO_COMPLETE
Simon Glass09140112020-05-10 11:40:03 -060088extern int var_complete(int argc, char *const argv[], char last_char, int maxv,
89 char *cmdv[]);
90extern int cmd_auto_complete(const char *const prompt, char *buf, int *np,
91 int *colp);
wdenk04a85b32004-04-15 18:22:41 +000092#endif
93
Simon Glass16ff9902014-02-26 15:59:15 -070094/**
95 * cmd_process_error() - report and process a possible error
96 *
97 * @cmdtp: Command which caused the error
98 * @err: Error code (0 if none, -ve for error, like -EIO)
Heinrich Schuchardt8a3d7342018-10-12 11:23:04 +020099 * @return 0 (CMD_RET_SUCCESS) if there is not error,
Michal Simek27eb7bc2018-06-21 14:49:26 +0200100 * 1 (CMD_RET_FAILURE) if an error is found
101 * -1 (CMD_RET_USAGE) if 'usage' error is found
Simon Glass16ff9902014-02-26 15:59:15 -0700102 */
Simon Glass09140112020-05-10 11:40:03 -0600103int cmd_process_error(struct cmd_tbl *cmdtp, int err);
Simon Glass16ff9902014-02-26 15:59:15 -0700104
wdenk78f66222002-08-27 10:27:51 +0000105/*
106 * Monitor Command
107 *
108 * All commands use a common argument format:
109 *
Simon Glass09140112020-05-10 11:40:03 -0600110 * void function(struct cmd_tbl *cmdtp, int flag, int argc,
111 * char *const argv[]);
wdenk78f66222002-08-27 10:27:51 +0000112 */
113
Simon Glass6f62d7c2017-08-04 16:34:38 -0600114#if defined(CONFIG_CMD_MEMORY) || \
115 defined(CONFIG_CMD_I2C) || \
116 defined(CONFIG_CMD_ITEST) || \
Bartosz Golaszewski75846442019-05-20 10:22:14 +0200117 defined(CONFIG_CMD_PCI) || \
118 defined(CONFIG_CMD_SETEXPR)
Jean-Christophe PLAGNIOL-VILLARD8a40fb12008-09-10 22:48:05 +0200119#define CMD_DATA_SIZE
Simon Glass7526dee2020-11-01 14:15:36 -0700120#define CMD_DATA_SIZE_ERR (-1)
121#define CMD_DATA_SIZE_STR (-2)
122
123/**
124 * cmd_get_data_size() - Get the data-size specifier from a command
125 *
126 * This reads a '.x' size specifier appended to a command. For example 'md.b'
127 * is the 'md' command with a '.b' specifier, meaning that the command should
128 * use bytes.
129 *
130 * Valid characters are:
131 *
132 * b - byte
133 * w - word (16 bits)
134 * l - long (32 bits)
135 * q - quad (64 bits)
136 * s - string
137 *
138 * @arg: Pointers to the command to check. If a valid specifier is present it
139 * will be the last character of the string, following a '.'
140 * @default_size: Default size to return if there is no specifier
141 * @return data size in bytes (1, 2, 4, 8) or CMD_DATA_SIZE_ERR for an invalid
142 * character, or CMD_DATA_SIZE_STR for a string
143 */
144int cmd_get_data_size(char *arg, int default_size);
Jean-Christophe PLAGNIOL-VILLARD8a40fb12008-09-10 22:48:05 +0200145#endif
146
Mike Frysinger7842fb72010-10-20 03:36:26 -0400147#ifdef CONFIG_CMD_BOOTD
Simon Glass09140112020-05-10 11:40:03 -0600148extern int do_bootd(struct cmd_tbl *cmdtp, int flag, int argc,
149 char *const argv[]);
Mike Frysinger7842fb72010-10-20 03:36:26 -0400150#endif
Mike Frysinger67d668b2011-06-05 13:43:02 +0000151#ifdef CONFIG_CMD_BOOTM
Simon Glass09140112020-05-10 11:40:03 -0600152extern int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc,
153 char *const argv[]);
154extern int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd);
Mike Frysinger67d668b2011-06-05 13:43:02 +0000155#else
Simon Glass09140112020-05-10 11:40:03 -0600156static inline int bootm_maybe_autostart(struct cmd_tbl *cmdtp, const char *cmd)
Mike Frysinger67d668b2011-06-05 13:43:02 +0000157{
158 return 0;
159}
160#endif
Rob Herring7405a132012-09-21 04:02:30 +0000161
Simon Glass09140112020-05-10 11:40:03 -0600162extern int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc,
163 char *const argv[]);
Rob Herringda620222012-12-02 21:00:23 -0600164
Simon Glass09140112020-05-10 11:40:03 -0600165extern int do_booti(struct cmd_tbl *cmdtp, int flag, int argc,
166 char *const argv[]);
Stephen Warren8b5c7382015-07-21 17:49:41 -0600167
Simon Glass09140112020-05-10 11:40:03 -0600168extern int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc,
Rob Herring7405a132012-09-21 04:02:30 +0000169 char *const argv[]);
170
Simon Glass09140112020-05-10 11:40:03 -0600171extern int do_reset(struct cmd_tbl *cmdtp, int flag, int argc,
172 char *const argv[]);
173extern int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc,
174 char *const argv[]);
Mike Frysinger36ebb782010-10-20 03:35:39 -0400175
Nitin Jain51916862018-02-16 12:56:17 +0530176extern unsigned long do_go_exec(ulong (*entry)(int, char * const []), int argc,
Simon Glass09140112020-05-10 11:40:03 -0600177 char *const argv[]);
AKASHI Takahiro49d81fd2019-02-25 15:54:36 +0900178
179#if defined(CONFIG_CMD_NVEDIT_EFI)
Simon Glass09140112020-05-10 11:40:03 -0600180extern int do_env_print_efi(struct cmd_tbl *cmdtp, int flag, int argc,
181 char *const argv[]);
182extern int do_env_set_efi(struct cmd_tbl *cmdtp, int flag, int argc,
183 char *const argv[]);
AKASHI Takahiro49d81fd2019-02-25 15:54:36 +0900184#endif
185
Simon Glass9d12d5d2012-02-14 19:59:25 +0000186/*
187 * Error codes that commands return to cmd_process(). We use the standard 0
188 * and 1 for success and failure, but add one more case - failure with a
189 * request to call cmd_usage(). But the cmd_process() function handles
190 * CMD_RET_USAGE itself and after calling cmd_usage() it will return 1.
191 * This is just a convenience for commands to avoid them having to call
192 * cmd_usage() all over the place.
193 */
194enum command_ret_t {
195 CMD_RET_SUCCESS, /* 0 = Success */
196 CMD_RET_FAILURE, /* 1 = Failure */
197 CMD_RET_USAGE = -1, /* Failure, please report 'usage' error */
198};
199
200/**
201 * Process a command with arguments. We look up the command and execute it
202 * if valid. Otherwise we print a usage message.
203 *
204 * @param flag Some flags normally 0 (see CMD_FLAG_.. above)
205 * @param argc Number of arguments (arg 0 must be the command text)
206 * @param argv Arguments
207 * @param repeatable This function sets this to 0 if the command is not
208 * repeatable. If the command is repeatable, the value
209 * is left unchanged.
Richard Genoud34765e82012-12-03 06:28:28 +0000210 * @param ticks If ticks is not null, this function set it to the
211 * number of ticks the command took to complete.
Simon Glass9d12d5d2012-02-14 19:59:25 +0000212 * @return 0 if the command succeeded, 1 if it failed
213 */
Simon Glass09140112020-05-10 11:40:03 -0600214int cmd_process(int flag, int argc, char *const argv[], int *repeatable,
215 unsigned long *ticks);
Simon Glassbdf8e342012-02-14 19:59:23 +0000216
Simon Glass09140112020-05-10 11:40:03 -0600217void fixup_cmdtable(struct cmd_tbl *cmdtp, int size);
Simon Glassf8bb6962016-03-19 02:18:38 -0600218
219/**
220 * board_run_command() - Fallback function to execute a command
221 *
222 * When no command line features are enabled in U-Boot, this function is
223 * called to execute a command. Typically the function can look at the
224 * command and perform a few very specific tasks, such as booting the
225 * system in a particular way.
226 *
227 * This function is only used when CONFIG_CMDLINE is not enabled.
228 *
229 * In normal situations this function should not return, since U-Boot will
230 * simply hang.
231 *
232 * @cmdline: Command line string to execute
233 * @return 0 if OK, 1 for error
234 */
235int board_run_command(const char *cmdline);
Simon Glass288b29e2019-11-14 12:57:43 -0700236
237int run_command(const char *cmd, int flag);
238int run_command_repeatable(const char *cmd, int flag);
239
240/**
241 * Run a list of commands separated by ; or even \0
242 *
243 * Note that if 'len' is not -1, then the command does not need to be nul
244 * terminated, Memory will be allocated for the command in that case.
245 *
246 * @param cmd List of commands to run, each separated bu semicolon
247 * @param len Length of commands excluding terminator if known (-1 if not)
248 * @param flag Execution flags (CMD_FLAG_...)
249 * @return 0 on success, or != 0 on error.
250 */
251int run_command_list(const char *cmd, int len, int flag);
wdenk78f66222002-08-27 10:27:51 +0000252#endif /* __ASSEMBLY__ */
253
254/*
255 * Command Flags:
256 */
257#define CMD_FLAG_REPEAT 0x0001 /* repeat last command */
258#define CMD_FLAG_BOOTD 0x0002 /* command is from bootd */
Simon Glass87b63982014-10-07 13:59:43 -0600259#define CMD_FLAG_ENV 0x0004 /* command is from the environment */
wdenk78f66222002-08-27 10:27:51 +0000260
Mike Frysinger722b0612010-10-20 03:52:39 -0400261#ifdef CONFIG_AUTO_COMPLETE
262# define _CMD_COMPLETE(x) x,
263#else
264# define _CMD_COMPLETE(x)
265#endif
266#ifdef CONFIG_SYS_LONGHELP
267# define _CMD_HELP(x) x,
268#else
269# define _CMD_HELP(x)
270#endif
wdenk8bde7f72003-06-27 21:31:46 +0000271
Boris Brezillonc0cf06e2018-12-03 22:54:21 +0100272#ifdef CONFIG_NEEDS_MANUAL_RELOC
273#define U_BOOT_SUBCMDS_RELOC(_cmdname) \
274 static void _cmdname##_subcmds_reloc(void) \
275 { \
276 static int relocated; \
277 \
278 if (relocated) \
279 return; \
280 \
281 fixup_cmdtable(_cmdname##_subcmds, \
282 ARRAY_SIZE(_cmdname##_subcmds)); \
283 relocated = 1; \
284 }
285#else
286#define U_BOOT_SUBCMDS_RELOC(_cmdname) \
287 static void _cmdname##_subcmds_reloc(void) { }
288#endif
289
290#define U_BOOT_SUBCMDS_DO_CMD(_cmdname) \
Simon Glass09140112020-05-10 11:40:03 -0600291 static int do_##_cmdname(struct cmd_tbl *cmdtp, int flag, \
292 int argc, char *const argv[], \
293 int *repeatable) \
Boris Brezillonc0cf06e2018-12-03 22:54:21 +0100294 { \
Simon Glass09140112020-05-10 11:40:03 -0600295 struct cmd_tbl *subcmd; \
Boris Brezillonc0cf06e2018-12-03 22:54:21 +0100296 \
297 _cmdname##_subcmds_reloc(); \
298 \
299 /* We need at least the cmd and subcmd names. */ \
300 if (argc < 2 || argc > CONFIG_SYS_MAXARGS) \
301 return CMD_RET_USAGE; \
302 \
303 subcmd = find_cmd_tbl(argv[1], _cmdname##_subcmds, \
304 ARRAY_SIZE(_cmdname##_subcmds)); \
305 if (!subcmd || argc - 1 > subcmd->maxargs) \
306 return CMD_RET_USAGE; \
307 \
308 if (flag == CMD_FLAG_REPEAT && \
309 !cmd_is_repeatable(subcmd)) \
310 return CMD_RET_SUCCESS; \
311 \
312 return subcmd->cmd_rep(subcmd, flag, argc - 1, \
313 argv + 1, repeatable); \
314 }
315
316#ifdef CONFIG_AUTO_COMPLETE
317#define U_BOOT_SUBCMDS_COMPLETE(_cmdname) \
Simon Glass09140112020-05-10 11:40:03 -0600318 static int complete_##_cmdname(int argc, char *const argv[], \
Boris Brezillonc0cf06e2018-12-03 22:54:21 +0100319 char last_char, int maxv, \
320 char *cmdv[]) \
321 { \
322 return complete_subcmdv(_cmdname##_subcmds, \
323 ARRAY_SIZE(_cmdname##_subcmds), \
324 argc - 1, argv + 1, last_char, \
325 maxv, cmdv); \
326 }
327#else
328#define U_BOOT_SUBCMDS_COMPLETE(_cmdname)
329#endif
330
331#define U_BOOT_SUBCMDS(_cmdname, ...) \
Simon Glass09140112020-05-10 11:40:03 -0600332 static struct cmd_tbl _cmdname##_subcmds[] = { __VA_ARGS__ }; \
Boris Brezillonc0cf06e2018-12-03 22:54:21 +0100333 U_BOOT_SUBCMDS_RELOC(_cmdname) \
334 U_BOOT_SUBCMDS_DO_CMD(_cmdname) \
335 U_BOOT_SUBCMDS_COMPLETE(_cmdname)
336
Simon Glassfb241122016-03-13 19:07:33 -0600337#ifdef CONFIG_CMDLINE
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100338#define U_BOOT_CMDREP_MKENT_COMPLETE(_name, _maxargs, _cmd_rep, \
339 _usage, _help, _comp) \
340 { #_name, _maxargs, _cmd_rep, cmd_discard_repeatable, \
341 _usage, _CMD_HELP(_help) _CMD_COMPLETE(_comp) }
342
Marek Vasut6c7c9462012-10-12 10:27:04 +0000343#define U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, \
344 _usage, _help, _comp) \
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100345 { #_name, _maxargs, \
346 _rep ? cmd_always_repeatable : cmd_never_repeatable, \
347 _cmd, _usage, _CMD_HELP(_help) _CMD_COMPLETE(_comp) }
wdenk8bde7f72003-06-27 21:31:46 +0000348
Marek Vasut6c7c9462012-10-12 10:27:04 +0000349#define U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, _comp) \
Simon Glass09140112020-05-10 11:40:03 -0600350 ll_entry_declare(struct cmd_tbl, _name, cmd) = \
Marek Vasut6c7c9462012-10-12 10:27:04 +0000351 U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, \
352 _usage, _help, _comp);
wdenk8bde7f72003-06-27 21:31:46 +0000353
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100354#define U_BOOT_CMDREP_COMPLETE(_name, _maxargs, _cmd_rep, _usage, \
355 _help, _comp) \
Simon Glass09140112020-05-10 11:40:03 -0600356 ll_entry_declare(struct cmd_tbl, _name, cmd) = \
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100357 U_BOOT_CMDREP_MKENT_COMPLETE(_name, _maxargs, _cmd_rep, \
358 _usage, _help, _comp)
359
Simon Glassfb241122016-03-13 19:07:33 -0600360#else
Simon Glass09140112020-05-10 11:40:03 -0600361#define U_BOOT_SUBCMD_START(name) static struct cmd_tbl name[] = {};
Simon Glassfb241122016-03-13 19:07:33 -0600362#define U_BOOT_SUBCMD_END
363
364#define _CMD_REMOVE(_name, _cmd) \
365 int __remove_ ## _name(void) \
366 { \
367 if (0) \
368 _cmd(NULL, 0, 0, NULL); \
369 return 0; \
370 }
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100371
372#define U_BOOT_CMDREP_MKENT_COMPLETE(_name, _maxargs, _cmd_rep, \
373 _usage, _help, _comp) \
374 { #_name, _maxargs, 0 ? _cmd_rep : NULL, NULL, _usage, \
375 _CMD_HELP(_help) _CMD_COMPLETE(_comp) }
376
Simon Glassfb241122016-03-13 19:07:33 -0600377#define U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, \
378 _help, _comp) \
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100379 { #_name, _maxargs, NULL, 0 ? _cmd : NULL, _usage, \
Simon Glassfb241122016-03-13 19:07:33 -0600380 _CMD_HELP(_help) _CMD_COMPLETE(_comp) }
381
382#define U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, \
383 _comp) \
384 _CMD_REMOVE(sub_ ## _name, _cmd)
385
Boris Brezillon80a48dd2018-12-03 22:54:20 +0100386#define U_BOOT_CMDREP_COMPLETE(_name, _maxargs, _cmd_rep, _usage, \
387 _help, _comp) \
388 _CMD_REMOVE(sub_ ## _name, _cmd_rep)
389
Simon Glassfb241122016-03-13 19:07:33 -0600390#endif /* CONFIG_CMDLINE */
391
Marek Vasut6c7c9462012-10-12 10:27:04 +0000392#define U_BOOT_CMD(_name, _maxargs, _rep, _cmd, _usage, _help) \
393 U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, _help, NULL)
wdenk8bde7f72003-06-27 21:31:46 +0000394
Simon Glassfb241122016-03-13 19:07:33 -0600395#define U_BOOT_CMD_MKENT(_name, _maxargs, _rep, _cmd, _usage, _help) \
396 U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _cmd, \
397 _usage, _help, NULL)
398
Boris Brezillonc0cf06e2018-12-03 22:54:21 +0100399#define U_BOOT_SUBCMD_MKENT_COMPLETE(_name, _maxargs, _rep, _do_cmd, \
400 _comp) \
401 U_BOOT_CMD_MKENT_COMPLETE(_name, _maxargs, _rep, _do_cmd, \
402 "", "", _comp)
403
404#define U_BOOT_SUBCMD_MKENT(_name, _maxargs, _rep, _do_cmd) \
405 U_BOOT_SUBCMD_MKENT_COMPLETE(_name, _maxargs, _rep, _do_cmd, \
406 NULL)
407
408#define U_BOOT_CMD_WITH_SUBCMDS(_name, _usage, _help, ...) \
409 U_BOOT_SUBCMDS(_name, __VA_ARGS__) \
410 U_BOOT_CMDREP_COMPLETE(_name, CONFIG_SYS_MAXARGS, do_##_name, \
411 _usage, _help, complete_##_name)
412
wdenk78f66222002-08-27 10:27:51 +0000413#endif /* __COMMAND_H */