Skip to content

Commit

Permalink
memory_display: Add 64bit support
Browse files Browse the repository at this point in the history
Add support for showing hexdumps in 64bit width.

Signed-off-by: Sascha Hauer <[email protected]>
  • Loading branch information
saschahauer committed May 28, 2015
1 parent ccd8dd4 commit 5878154
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion common/memory_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 5878154

Please sign in to comment.