target: change prototype of target_process_reset()

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 target_process_reset() to pass CMD instead of
CMD_CTX.
Replace NULL parameter of command_print().
Remove extra newline, already added by command_print().

Change-Id: Ieb820c2586e1ff74a0c2b63a9c8693ca7710dfb7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5048
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
bscan_optimization
Antonio Borneo 2019-04-01 08:44:26 +02:00 committed by Tomas Vanek
parent 84cfb727df
commit 74cd25a4d3
1 changed files with 5 additions and 5 deletions

View File

@ -640,7 +640,7 @@ int target_resume(struct target *target, int current, target_addr_t address,
return retval;
}
static int target_process_reset(struct command_context *cmd_ctx, enum target_reset_mode reset_mode)
static int target_process_reset(struct command_invocation *cmd, enum target_reset_mode reset_mode)
{
char buf[100];
int retval;
@ -664,13 +664,13 @@ static int target_process_reset(struct command_context *cmd_ctx, enum target_res
jtag_poll_set_enabled(false);
sprintf(buf, "ocd_process_reset %s", n->name);
retval = Jim_Eval(cmd_ctx->interp, buf);
retval = Jim_Eval(cmd->ctx->interp, buf);
jtag_poll_set_enabled(save_poll);
if (retval != JIM_OK) {
Jim_MakeErrorMessage(cmd_ctx->interp);
command_print(NULL, "%s\n", Jim_GetString(Jim_GetResult(cmd_ctx->interp), NULL));
Jim_MakeErrorMessage(cmd->ctx->interp);
command_print(cmd->ctx, "%s", Jim_GetString(Jim_GetResult(cmd->ctx->interp), NULL));
return ERROR_FAIL;
}
@ -3079,7 +3079,7 @@ COMMAND_HANDLER(handle_reset_command)
}
/* reset *all* targets */
return target_process_reset(CMD_CTX, reset_mode);
return target_process_reset(CMD, reset_mode);
}