target: add 64-bit address array command support
Add 64-bit address support to the target mem2array and array2mem commands Change-Id: Ibdcc076ca5581f4fd87e92318aab33907e22d6ce Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Reviewed-on: http://openocd.zylin.com/6246 Tested-by: jenkins Reviewed-by: Jan Matyas <matyas@codasip.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
parent
6f439e2032
commit
c819444e96
|
@ -4419,9 +4419,10 @@ static int jim_mem2array(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
|
|||
static int target_mem2array(Jim_Interp *interp, struct target *target, int argc, Jim_Obj *const *argv)
|
||||
{
|
||||
long l;
|
||||
jim_wide wide_addr;
|
||||
uint32_t width;
|
||||
int len;
|
||||
uint32_t addr;
|
||||
target_addr_t addr;
|
||||
uint32_t count;
|
||||
uint32_t v;
|
||||
const char *varname;
|
||||
|
@ -4448,8 +4449,8 @@ static int target_mem2array(Jim_Interp *interp, struct target *target, int argc,
|
|||
if (e != JIM_OK)
|
||||
return e;
|
||||
|
||||
e = Jim_GetLong(interp, argv[2], &l);
|
||||
addr = l;
|
||||
e = Jim_GetWide(interp, argv[2], &wide_addr);
|
||||
addr = (target_addr_t)wide_addr;
|
||||
if (e != JIM_OK)
|
||||
return e;
|
||||
e = Jim_GetLong(interp, argv[3], &l);
|
||||
|
@ -4503,7 +4504,7 @@ static int target_mem2array(Jim_Interp *interp, struct target *target, int argc,
|
|||
} else {
|
||||
char buf[100];
|
||||
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
|
||||
sprintf(buf, "mem2array address: 0x%08" PRIx32 " is not aligned for %" PRIu32 " byte reads",
|
||||
sprintf(buf, "mem2array address: " TARGET_ADDR_FMT " is not aligned for %" PRIu32 " byte reads",
|
||||
addr,
|
||||
width);
|
||||
Jim_AppendStrings(interp, Jim_GetResult(interp), buf, NULL);
|
||||
|
@ -4535,7 +4536,7 @@ static int target_mem2array(Jim_Interp *interp, struct target *target, int argc,
|
|||
retval = target_read_memory(target, addr, width, count, buffer);
|
||||
if (retval != ERROR_OK) {
|
||||
/* BOO !*/
|
||||
LOG_ERROR("mem2array: Read @ 0x%08" PRIx32 ", w=%" PRIu32 ", cnt=%" PRIu32 ", failed",
|
||||
LOG_ERROR("mem2array: Read @ " TARGET_ADDR_FMT ", w=%" PRIu32 ", cnt=%" PRIu32 ", failed",
|
||||
addr,
|
||||
width,
|
||||
count);
|
||||
|
@ -4622,9 +4623,10 @@ static int target_array2mem(Jim_Interp *interp, struct target *target,
|
|||
int argc, Jim_Obj *const *argv)
|
||||
{
|
||||
long l;
|
||||
jim_wide wide_addr;
|
||||
uint32_t width;
|
||||
int len;
|
||||
uint32_t addr;
|
||||
target_addr_t addr;
|
||||
uint32_t count;
|
||||
uint32_t v;
|
||||
const char *varname;
|
||||
|
@ -4650,8 +4652,8 @@ static int target_array2mem(Jim_Interp *interp, struct target *target,
|
|||
if (e != JIM_OK)
|
||||
return e;
|
||||
|
||||
e = Jim_GetLong(interp, argv[2], &l);
|
||||
addr = l;
|
||||
e = Jim_GetWide(interp, argv[2], &wide_addr);
|
||||
addr = (target_addr_t)wide_addr;
|
||||
if (e != JIM_OK)
|
||||
return e;
|
||||
e = Jim_GetLong(interp, argv[3], &l);
|
||||
|
@ -4709,7 +4711,7 @@ static int target_array2mem(Jim_Interp *interp, struct target *target,
|
|||
} else {
|
||||
char buf[100];
|
||||
Jim_SetResult(interp, Jim_NewEmptyStringObj(interp));
|
||||
sprintf(buf, "array2mem address: 0x%08" PRIx32 " is not aligned for %" PRIu32 " byte reads",
|
||||
sprintf(buf, "array2mem address: " TARGET_ADDR_FMT " is not aligned for %" PRIu32 " byte reads",
|
||||
addr,
|
||||
width);
|
||||
Jim_AppendStrings(interp, Jim_GetResult(interp), buf, NULL);
|
||||
|
@ -4758,7 +4760,7 @@ static int target_array2mem(Jim_Interp *interp, struct target *target,
|
|||
retval = target_write_memory(target, addr, width, count, buffer);
|
||||
if (retval != ERROR_OK) {
|
||||
/* BOO !*/
|
||||
LOG_ERROR("array2mem: Write @ 0x%08" PRIx32 ", w=%" PRIu32 ", cnt=%" PRIu32 ", failed",
|
||||
LOG_ERROR("array2mem: Write @ " TARGET_ADDR_FMT ", w=%" PRIu32 ", cnt=%" PRIu32 ", failed",
|
||||
addr,
|
||||
width,
|
||||
count);
|
||||
|
|
Loading…
Reference in New Issue