diff options
author | Robert Schwebel <r.schwebel@pengutronix.de> | 2010-12-13 22:22:16 +0100 |
---|---|---|
committer | Robert Schwebel <r.schwebel@pengutronix.de> | 2010-12-17 21:28:42 +0100 |
commit | 1bce4fa451f1f2881d316441c5cb12a25222a4c4 (patch) | |
tree | a273edd13d68474a634aa19779153adfad522a37 | |
parent | 29202f7912d928c4d3f1162487d88f38be71ff49 (diff) | |
download | barebox-1bce4fa451f1f2881d316441c5cb12a25222a4c4.tar.gz barebox-1bce4fa451f1f2881d316441c5cb12a25222a4c4.tar.xz |
doc: add documentation for 'memcmp' command
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
-rw-r--r-- | Documentation/commands.dox | 2 | ||||
-rw-r--r-- | commands/mem.c | 33 |
2 files changed, 20 insertions, 15 deletions
diff --git a/Documentation/commands.dox b/Documentation/commands.dox index c9a786d1..7f5c4f7d 100644 --- a/Documentation/commands.dox +++ b/Documentation/commands.dox @@ -67,7 +67,7 @@ available in @a Barebox: @li @subpage ls_command @li @subpage lsmod_command @li @subpage md -@li @subpage memcmp +@li @subpage memcmp_command @li @subpage meminfo_command @li @subpage memset @li @subpage menu diff --git a/commands/mem.c b/commands/mem.c index dc778d3e..f9f71a7d 100644 --- a/commands/mem.c +++ b/commands/mem.c @@ -310,7 +310,7 @@ BAREBOX_CMD_START(mw) BAREBOX_CMD_HELP(cmd_mw_help) BAREBOX_CMD_END -static int do_mem_cmp(struct command *cmdtp, int argc, char *argv[]) +static int do_memcmp(struct command *cmdtp, int argc, char *argv[]) { ulong addr1, addr2, count = ~0; int mode = O_RWSIZE_1; @@ -400,21 +400,26 @@ out: return ret; } -static const __maybe_unused char cmd_memcmp_help[] = -"Usage: memcmp [OPTIONS] <addr1> <addr2> <count>\n" -"\n" -"options:\n" -" -b, -w, -l use byte, halfword, or word accesses\n" -" -s <file> source file (default /dev/mem)\n" -" -d <file> destination file (default /dev/mem)\n" -"\n" -"Compare memory regions specified with addr1 and addr2\n" -"of size <count> bytes. If source is a file count can\n" -"be left unspecified in which case the whole file is\n" -"compared\n"; +BAREBOX_CMD_HELP_START(memcmp) +BAREBOX_CMD_HELP_USAGE("memcmp [OPTIONS] ADDR1 ADDR2 COUNT\n") +BAREBOX_CMD_HELP_SHORT("Compare memory regions ADDR1 and ADDR2 of COUNT bytes.\n") +BAREBOX_CMD_HELP_OPT ("-b, -w, -l", "use byte, halfword or word accesses\n") +BAREBOX_CMD_HELP_OPT ("-s <file>", "source file (default: /dev/mem)\n") +BAREBOX_CMD_HELP_OPT ("-d <file>", "destination file (default: /dev/mem)\n") +BAREBOX_CMD_HELP_END + +/** + * @page memcmp_command + +<p> If source is a file, count can be left unspecified. In this case the +whole file is compared.</p> + +\todo Add example. + + */ BAREBOX_CMD_START(memcmp) - .cmd = do_mem_cmp, + .cmd = do_memcmp, .usage = "memory compare", BAREBOX_CMD_HELP(cmd_memcmp_help) BAREBOX_CMD_END |