Index: commands.c
===================================================================
--- commands.c (revision 22)
+++ commands.c (working copy)
@@ -35,6 +35,7 @@
MAKE_SIZE_PARAM(8);
MAKE_SIZE_PARAM(16);
MAKE_SIZE_PARAM(32);
+MAKE_SIZE_PARAM(64);
static struct cmd_group *group_head;
Index: commands.h
===================================================================
--- commands.h (revision 22)
+++ commands.h (working copy)
@@ -26,6 +26,7 @@
uint8_t u8;
uint16_t u16;
uint32_t u32;
+ uint64_t u64;
} data_store;
@@ -35,7 +36,8 @@
{
SIZE8 = 8,
SIZE16 = 16,
- SIZE32 = 32
+ SIZE32 = 32,
+ SIZE64 = 64,
};
struct size_param {
@@ -48,6 +50,7 @@
EXTERN_SIZE_PARAM(8);
EXTERN_SIZE_PARAM(16);
EXTERN_SIZE_PARAM(32);
+EXTERN_SIZE_PARAM(64);
/* The min and max args need to include the argv[0] parameter. For example,
* 'shl 1 3' would list the min and max arguments as 3. */
Index: mmio_rw.c
===================================================================
--- mmio_rw.c (revision 23)
+++ mmio_rw.c (working copy)
@@ -107,8 +107,8 @@
#define DO_READ(mem_, off_, size_)\
data.u ##size_ = *(typeof(data.u ##size_) *)(mem_ + off_); \
- fprintf(stdout, "0x%0*x\n", (int)sizeof(data.u ##size_)*2, \
- data.u ##size_)
+ fprintf(stdout, "0x%0*llx\n", (int)sizeof(data.u ##size_)*2, \
+ (unsigned long long)data.u ##size_)
switch (get_command_size(info)) {
case SIZE8:
@@ -120,6 +120,13 @@
case SIZE32:
DO_READ(mmap_addr.mem, mmap_addr.off, 32);
break;
+ case SIZE64:
+ if (sizeof(void *) != sizeof(uint64_t)) {
+ fprintf(stderr, "warning: 64 bit operations might "
+ "not be atomic on 32 bit applications\n");
+ }
+ DO_READ(mmap_addr.mem, mmap_addr.off, 64);
+ break;
default:
fprintf(stderr, "invalid mmio_read parameter\n");
ret = -1;
@@ -161,6 +168,13 @@
case SIZE32:
DO_WRITE(mmap_addr.mem, mmap_addr.off, 32);
break;
+ case SIZE64:
+ if (sizeof(void *) != sizeof(uint64_t)) {
+ fprintf(stderr, "warning: 64 bit operations might "
+ "not be atomic on 32 bit applications\n");
+ }
+ DO_WRITE(mmap_addr.mem, mmap_addr.off, 64);
+ break;
default:
fprintf(stderr, "invalid mmio_write parameter\n");
ret = -1;
@@ -271,6 +285,7 @@
MAKE_MMIO_RW_CMD_PAIR(8),
MAKE_MMIO_RW_CMD_PAIR(16),
MAKE_MMIO_RW_CMD_PAIR(32),
+ MAKE_MMIO_RW_CMD_PAIR(64),
MAKE_CMD_WITH_PARAMS(mmio_dump, &mmio_dump, NULL, &dump_params)
};