From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 10/10] mw command: Add 64bit support
Date: Thu, 28 May 2015 12:34:44 +0200 [thread overview]
Message-ID: <1432809284-17362-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1432809284-17362-1-git-send-email-s.hauer@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
commands/mw.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/commands/mw.c b/commands/mw.c
index f0384f6..8ca3c61 100644
--- a/commands/mw.c
+++ b/commands/mw.c
@@ -42,7 +42,7 @@ static int do_mem_mw(int argc, char *argv[])
loff_t adr;
int swab = 0;
- if (mem_parse_options(argc, argv, "bwld:x", &mode, NULL, &filename,
+ if (mem_parse_options(argc, argv, "bwlqd:x", &mode, NULL, &filename,
&swab) < 0)
return 1;
@@ -59,6 +59,7 @@ static int do_mem_mw(int argc, char *argv[])
u8 val8;
u16 val16;
u32 val32;
+ u64 val64;
switch (mode) {
case O_RWSIZE_1:
val8 = simple_strtoul(argv[optind], NULL, 0);
@@ -76,6 +77,12 @@ static int do_mem_mw(int argc, char *argv[])
val32 = __swab32(val32);
ret = write(fd, &val32, 4);
break;
+ case O_RWSIZE_8:
+ val64 = simple_strtoull(argv[optind], NULL, 0);
+ if (swab)
+ val64 = __swab64(val64);
+ ret = write(fd, &val64, 8);
+ break;
}
if (ret < 0) {
perror("write");
@@ -97,6 +104,7 @@ BAREBOX_CMD_HELP_TEXT("Options:")
BAREBOX_CMD_HELP_OPT ("-b", "byte access")
BAREBOX_CMD_HELP_OPT ("-w", "word access (16 bit)")
BAREBOX_CMD_HELP_OPT ("-l", "long access (32 bit)")
+BAREBOX_CMD_HELP_OPT ("-q", "quad access (64 bit)")
BAREBOX_CMD_HELP_OPT ("-d FILE", "write file (default /dev/mem)")
BAREBOX_CMD_HELP_END
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2015-05-28 10:35 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 10:34 Add 64bit support to mem commands Sascha Hauer
2015-05-28 10:34 ` [PATCH 01/10] memory_display: Use consistent types Sascha Hauer
2015-05-28 10:34 ` [PATCH 02/10] memory_display: Add 64bit support Sascha Hauer
2015-05-28 10:34 ` [PATCH 03/10] fs: Add O_RWSIZE_8 Sascha Hauer
2015-05-28 10:34 ` [PATCH 04/10] mem commands: suppport parsing 'q' option Sascha Hauer
2015-05-28 10:34 ` [PATCH 05/10] md command: Add 64bit support Sascha Hauer
2015-05-28 10:34 ` [PATCH 06/10] memcmp " Sascha Hauer
2015-05-28 10:34 ` [PATCH 07/10] memcpy " Sascha Hauer
2015-05-28 10:34 ` [PATCH 08/10] memset " Sascha Hauer
2015-05-28 10:34 ` [PATCH 09/10] mm " Sascha Hauer
2015-05-28 10:34 ` Sascha Hauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432809284-17362-11-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox