summaryrefslogtreecommitdiffstats
path: root/common/memory_display.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-05-27 11:10:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-05-28 12:29:49 +0200
commit5878154ba8ce619ba7afd81ea169be68404946a4 (patch)
tree5206e6ed152a74d31acf8c375f780b92d64f2d1d /common/memory_display.c
parentccd8dd48cd8eb9af5049d87ec6b2431d82976a7f (diff)
downloadbarebox-5878154ba8ce619ba7afd81ea169be68404946a4.tar.gz
memory_display: Add 64bit support
Add support for showing hexdumps in 64bit width. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/memory_display.c')
-rw-r--r--common/memory_display.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/memory_display.c b/common/memory_display.c
index 1ad0f05..ea91985 100644
--- a/common/memory_display.c
+++ b/common/memory_display.c
@@ -16,6 +16,7 @@ int memory_display(const void *addr, loff_t offs, unsigned nbytes, int size, int
*/
do {
unsigned char linebuf[DISP_LINE_LEN];
+ uint64_t *ullp = (uint64_t *)linebuf;
uint32_t *uip = (uint32_t *)linebuf;
uint16_t *usp = (uint16_t *)linebuf;
uint8_t *ucp = (uint8_t *)linebuf;
@@ -25,7 +26,20 @@ int memory_display(const void *addr, loff_t offs, unsigned nbytes, int size, int
linebytes = (nbytes > DISP_LINE_LEN) ? DISP_LINE_LEN : nbytes;
for (i = 0; i < linebytes; i += size) {
- if (size == 4) {
+ if (size == 8) {
+ uint64_t res;
+ data_abort_mask();
+ res = *((uint64_t *)addr);
+ if (swab)
+ res = __swab64(res);
+ if (data_abort_unmask()) {
+ res = 0xffffffffffffffffULL;
+ count -= printf(" xxxxxxxxxxxxxxxx");
+ } else {
+ count -= printf(" %016llx", res);
+ }
+ *ullp++ = res;
+ } else if (size == 4) {
uint32_t res;
data_abort_mask();
res = *((uint32_t *)addr);