target/arm920t: change prototype of arm920t_verify_pointer()
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should be ready to switch to CMD as first parameter. Change prototype of arm920t_verify_pointer() to pass CMD instead of CMD_CTX. This change was part of http://openocd.zylin.com/1815 from Paul Fertser and has been extracted and rebased to simplify the review. Change-Id: I9a603d7c032df91b3913aadb242de89dbed0358e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5056 Tested-by: jenkinsbscan_optimization
parent
d06b952376
commit
fce3b698fb
|
@ -507,11 +507,11 @@ void arm920t_pre_restore_context(struct target *target)
|
||||||
|
|
||||||
static const char arm920_not[] = "target is not an ARM920";
|
static const char arm920_not[] = "target is not an ARM920";
|
||||||
|
|
||||||
static int arm920t_verify_pointer(struct command_context *cmd_ctx,
|
static int arm920t_verify_pointer(struct command_invocation *cmd,
|
||||||
struct arm920t_common *arm920t)
|
struct arm920t_common *arm920t)
|
||||||
{
|
{
|
||||||
if (arm920t->common_magic != ARM920T_COMMON_MAGIC) {
|
if (arm920t->common_magic != ARM920T_COMMON_MAGIC) {
|
||||||
command_print(cmd_ctx, arm920_not);
|
command_print(cmd->ctx, arm920_not);
|
||||||
return ERROR_TARGET_INVALID;
|
return ERROR_TARGET_INVALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,7 +869,7 @@ COMMAND_HANDLER(arm920t_handle_read_cache_command)
|
||||||
int segment, index_t;
|
int segment, index_t;
|
||||||
struct reg *r;
|
struct reg *r;
|
||||||
|
|
||||||
retval = arm920t_verify_pointer(CMD_CTX, arm920t);
|
retval = arm920t_verify_pointer(CMD, arm920t);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -1151,7 +1151,7 @@ COMMAND_HANDLER(arm920t_handle_read_mmu_command)
|
||||||
int victim;
|
int victim;
|
||||||
struct reg *r;
|
struct reg *r;
|
||||||
|
|
||||||
retval = arm920t_verify_pointer(CMD_CTX, arm920t);
|
retval = arm920t_verify_pointer(CMD, arm920t);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -1451,7 +1451,7 @@ COMMAND_HANDLER(arm920t_handle_cp15_command)
|
||||||
struct target *target = get_current_target(CMD_CTX);
|
struct target *target = get_current_target(CMD_CTX);
|
||||||
struct arm920t_common *arm920t = target_to_arm920(target);
|
struct arm920t_common *arm920t = target_to_arm920(target);
|
||||||
|
|
||||||
retval = arm920t_verify_pointer(CMD_CTX, arm920t);
|
retval = arm920t_verify_pointer(CMD, arm920t);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -1507,7 +1507,7 @@ COMMAND_HANDLER(arm920t_handle_cp15i_command)
|
||||||
struct target *target = get_current_target(CMD_CTX);
|
struct target *target = get_current_target(CMD_CTX);
|
||||||
struct arm920t_common *arm920t = target_to_arm920(target);
|
struct arm920t_common *arm920t = target_to_arm920(target);
|
||||||
|
|
||||||
retval = arm920t_verify_pointer(CMD_CTX, arm920t);
|
retval = arm920t_verify_pointer(CMD, arm920t);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
@ -1581,7 +1581,7 @@ COMMAND_HANDLER(arm920t_handle_cache_info_command)
|
||||||
struct target *target = get_current_target(CMD_CTX);
|
struct target *target = get_current_target(CMD_CTX);
|
||||||
struct arm920t_common *arm920t = target_to_arm920(target);
|
struct arm920t_common *arm920t = target_to_arm920(target);
|
||||||
|
|
||||||
retval = arm920t_verify_pointer(CMD_CTX, arm920t);
|
retval = arm920t_verify_pointer(CMD, arm920t);
|
||||||
if (retval != ERROR_OK)
|
if (retval != ERROR_OK)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue