diff options
author | Paul Fertser <fercerpav@gmail.com> | 2019-04-01 04:55:27 +0200 |
---|---|---|
committer | Tomas Vanek <vanekt@fbl.cz> | 2019-05-14 19:34:49 +0100 |
commit | 07632ab94c57943b786c9f274c74f344797d8301 (patch) | |
tree | d1d483462a61604cf12382edec22f3bb59cadc20 /src | |
parent | c734202dc89bb3ee05a204140b3c890451e79686 (diff) | |
download | riscv-openocd-07632ab94c57943b786c9f274c74f344797d8301.zip riscv-openocd-07632ab94c57943b786c9f274c74f344797d8301.tar.gz riscv-openocd-07632ab94c57943b786c9f274c74f344797d8301.tar.bz2 |
target/cortex_m: change prototype of cortex_m_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 cortex_m_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: Icf6d1e5f8b4a3ce115c4253e49769df19a5211ae
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/5061
Tested-by: jenkins
Diffstat (limited to 'src')
-rw-r--r-- | src/target/cortex_m.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index e883925..639e09f 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -2366,11 +2366,11 @@ static int cortex_m_target_create(struct target *target, Jim_Interp *interp) /*--------------------------------------------------------------------------*/ -static int cortex_m_verify_pointer(struct command_context *cmd_ctx, +static int cortex_m_verify_pointer(struct command_invocation *cmd, struct cortex_m_common *cm) { if (cm->common_magic != CORTEX_M_COMMON_MAGIC) { - command_print(cmd_ctx, "target is not a Cortex-M"); + command_print(cmd->ctx, "target is not a Cortex-M"); return ERROR_TARGET_INVALID; } return ERROR_OK; @@ -2404,7 +2404,7 @@ COMMAND_HANDLER(handle_cortex_m_vector_catch_command) { "reset", VC_CORERESET, }, }; - retval = cortex_m_verify_pointer(CMD_CTX, cortex_m); + retval = cortex_m_verify_pointer(CMD, cortex_m); if (retval != ERROR_OK) return retval; @@ -2482,7 +2482,7 @@ COMMAND_HANDLER(handle_cortex_m_mask_interrupts_command) const Jim_Nvp *n; - retval = cortex_m_verify_pointer(CMD_CTX, cortex_m); + retval = cortex_m_verify_pointer(CMD, cortex_m); if (retval != ERROR_OK) return retval; @@ -2512,7 +2512,7 @@ COMMAND_HANDLER(handle_cortex_m_reset_config_command) int retval; char *reset_config; - retval = cortex_m_verify_pointer(CMD_CTX, cortex_m); + retval = cortex_m_verify_pointer(CMD, cortex_m); if (retval != ERROR_OK) return retval; |