X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Ftarget%2Ftarget.c;h=7763b95644d65d3dfce0d86e39e65e43dbde5112;hp=8bb9371f903bca836e16a17021668ac79dc8a21e;hb=6a2fd7cad507ef24a7dc4ce3c5f8b5351dd12656;hpb=026559068d889660ad4545ee28b6561c82c39aea diff --git a/src/target/target.c b/src/target/target.c index 8bb9371f90..7763b95644 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -698,7 +698,6 @@ int target_init(struct command_context_s *cmd_ctx) { target->type->virt2phys = default_virt2phys; } - target->type->virt2phys = default_virt2phys; /* a non-invasive way(in terms of patches) to add some code that * runs before the type->write/read_memory implementation */ @@ -3452,6 +3451,10 @@ void target_all_handle_event(enum target_event e) } } + +/* FIX? should we propagate errors here rather than printing them + * and continuing? + */ void target_handle_event(target_t *target, enum target_event e) { target_event_action_t *teap; @@ -4093,11 +4096,11 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv) /* do the assert */ if (n->value == NVP_ASSERT) { - target->type->assert_reset(target); + e = target->type->assert_reset(target); } else { - target->type->deassert_reset(target); + e = target->type->deassert_reset(target); } - return JIM_OK; + return (e == ERROR_OK) ? JIM_OK : JIM_ERR; case TS_CMD_HALT: if (goi.argc) { Jim_WrongNumArgs(goi.interp, 0, argv, "halt [no parameters]"); @@ -4105,8 +4108,8 @@ static int tcl_target_func(Jim_Interp *interp, int argc, Jim_Obj *const *argv) } if (!target->tap->enabled) goto err_tap_disabled; - target->type->halt(target); - return JIM_OK; + e = target->type->halt(target); + return (e == ERROR_OK) ? JIM_OK : JIM_ERR; case TS_CMD_WAITSTATE: /* params: statename timeoutmsecs */ if (goi.argc != 2) {