[PATCH 33/34] doc: add documentation for 'memcmp' command

Robert Schwebel r.schwebel at pengutronix.de
Wed Dec 15 06:51:47 EST 2010

Signed-off-by: Robert Schwebel <r.schwebel at pengutronix.de>
 Documentation/commands.dox |    2 +-
 commands/mem.c             |   33 +++++++++++++++++++--------------
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/Documentation/commands.dox b/Documentation/commands.dox
index c9a786d..7f5c4f7 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
- at li @subpage memcmp
+ at 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 dc778d3..f9f71a7 100644
--- a/commands/mem.c
+++ b/commands/mem.c
@@ -310,7 +310,7 @@ BAREBOX_CMD_START(mw)
-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"
-"  -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"
-"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"
+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")
+ * @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.
+ */
-	.cmd		= do_mem_cmp,
+	.cmd		= do_memcmp,
 	.usage		= "memory compare",

More information about the barebox mailing list