You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: openocd-gerrit <ope...@us...> - 2025-04-19 09:22:43
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 29e4a366222b96aac89dbec11e5f4a83a6a83bbe (commit) via 4a616ca4d83919fea03bf084ff326f584de558d7 (commit) from a1ecf0a03d9812c285618ed995ea818eba020be3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 29e4a366222b96aac89dbec11e5f4a83a6a83bbe Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 23:01:44 2023 +0100 target: rewrite command 'target create' as COMMAND_HANDLER Rewrite only the command, but still use the old jimtcl specific code shared with 'configure' and 'cget'. Change-Id: I7cf220e494f0ebbf123f8075b1feb9251fd7f569 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8827 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 3f16caaff..9d9d73a28 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -5673,44 +5673,29 @@ static const struct command_registration target_instance_command_handlers[] = { COMMAND_REGISTRATION_DONE }; -static int target_create(struct jim_getopt_info *goi) +COMMAND_HANDLER(handle_target_create) { - Jim_Obj *new_cmd; - Jim_Cmd *cmd; - const char *cp; - int e; + int retval = ERROR_OK; int x; - struct target *target; - struct command_context *cmd_ctx; - cmd_ctx = current_command_context(goi->interp); - assert(cmd_ctx); - - if (goi->argc < 3) { - Jim_WrongNumArgs(goi->interp, 1, goi->argv, "?name? ?type? ..options..."); - return JIM_ERR; - } + if (CMD_ARGC < 4) + return ERROR_COMMAND_SYNTAX_ERROR; - /* COMMAND */ - jim_getopt_obj(goi, &new_cmd); - /* does this command exist? */ - cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_NONE); - if (cmd) { - cp = Jim_GetString(new_cmd, NULL); - Jim_SetResultFormatted(goi->interp, "Command/target: %s Exists", cp); - return JIM_ERR; + /* check if the target name clashes with an existing command name */ + Jim_Cmd *jimcmd = Jim_GetCommand(CMD_CTX->interp, CMD_JIMTCL_ARGV[0], JIM_NONE); + if (jimcmd) { + command_print(CMD, "Command/target: %s Exists", CMD_ARGV[0]); + return ERROR_FAIL; } /* TYPE */ - e = jim_getopt_string(goi, &cp, NULL); - if (e != JIM_OK) - return e; + const char *cp = CMD_ARGV[1]; struct transport *tr = get_current_transport(); if (tr && tr->override_target) { - e = tr->override_target(&cp); - if (e != ERROR_OK) { - LOG_ERROR("The selected transport doesn't support this target"); - return JIM_ERR; + retval = tr->override_target(&cp); + if (retval != ERROR_OK) { + command_print(CMD, "The selected transport doesn't support this target"); + return retval; } LOG_INFO("The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD"); } @@ -5722,28 +5707,29 @@ static int target_create(struct jim_getopt_info *goi) } } if (!target_types[x]) { - Jim_SetResultFormatted(goi->interp, "Unknown target type %s, try one of ", cp); + char *all = NULL; for (x = 0 ; target_types[x] ; x++) { - if (target_types[x + 1]) { - Jim_AppendStrings(goi->interp, - Jim_GetResult(goi->interp), - target_types[x]->name, - ", ", NULL); - } else { - Jim_AppendStrings(goi->interp, - Jim_GetResult(goi->interp), - " or ", - target_types[x]->name, NULL); + char *prev = all; + if (all) + all = alloc_printf("%s, %s", all, target_types[x]->name); + else + all = alloc_printf("%s", target_types[x]->name); + free(prev); + if (!all) { + LOG_ERROR("Out of memory"); + return ERROR_FAIL; } } - return JIM_ERR; + command_print(CMD, "Unknown target type %s, try one of %s", cp, all); + free(all); + return ERROR_FAIL; } /* Create it */ - target = calloc(1, sizeof(struct target)); + struct target *target = calloc(1, sizeof(struct target)); if (!target) { LOG_ERROR("Out of memory"); - return JIM_ERR; + return ERROR_FAIL; } /* set empty smp cluster */ @@ -5754,7 +5740,7 @@ static int target_create(struct jim_getopt_info *goi) if (!target->type) { LOG_ERROR("Out of memory"); free(target); - return JIM_ERR; + return ERROR_FAIL; } memcpy(target->type, target_types[x], sizeof(struct target_type)); @@ -5787,7 +5773,7 @@ static int target_create(struct jim_getopt_info *goi) LOG_ERROR("Out of memory"); free(target->type); free(target); - return JIM_ERR; + return ERROR_FAIL; } target->dbgmsg = NULL; @@ -5801,45 +5787,54 @@ static int target_create(struct jim_getopt_info *goi) target->gdb_port_override = NULL; target->gdb_max_connections = 1; - cp = Jim_GetString(new_cmd, NULL); - target->cmd_name = strdup(cp); + target->cmd_name = strdup(CMD_ARGV[0]); if (!target->cmd_name) { LOG_ERROR("Out of memory"); free(target->trace_info); free(target->type); free(target); - return JIM_ERR; + return ERROR_FAIL; } /* Do the rest as "configure" options */ - goi->is_configure = true; - e = target_configure(goi, target); + struct jim_getopt_info goi; + jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - 2, CMD_JIMTCL_ARGV + 2); + + goi.is_configure = 1; + int e = target_configure(&goi, target); + + int reslen; + const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen); + if (reslen > 0) + command_print(CMD, "%s", result); if (e == JIM_OK) { if (target->has_dap) { if (!target->dap_configured) { - Jim_SetResultString(goi->interp, "-dap ?name? required when creating target", -1); - e = JIM_ERR; + command_print(CMD, "-dap ?name? required when creating target"); + retval = ERROR_COMMAND_ARGUMENT_INVALID; } } else { if (!target->tap_configured) { - Jim_SetResultString(goi->interp, "-chain-position ?name? required when creating target", -1); - e = JIM_ERR; + command_print(CMD, "-chain-position ?name? required when creating target"); + retval = ERROR_COMMAND_ARGUMENT_INVALID; } } /* tap must be set after target was configured */ if (!target->tap) - e = JIM_ERR; + retval = ERROR_COMMAND_ARGUMENT_INVALID; + } else { + retval = ERROR_FAIL; } - if (e != JIM_OK) { + if (retval != ERROR_OK) { rtos_destroy(target); free(target->gdb_port_override); free(target->trace_info); free(target->type); free(target->private_config); free(target); - return e; + return retval; } if (target->endianness == TARGET_ENDIAN_UNKNOWN) { @@ -5848,8 +5843,8 @@ static int target_create(struct jim_getopt_info *goi) } if (target->type->target_create) { - e = (*(target->type->target_create))(target, goi->interp); - if (e != ERROR_OK) { + retval = (*target->type->target_create)(target, CMD_CTX->interp); + if (retval != ERROR_OK) { LOG_DEBUG("target_create failed"); free(target->cmd_name); rtos_destroy(target); @@ -5858,15 +5853,15 @@ static int target_create(struct jim_getopt_info *goi) free(target->type); free(target->private_config); free(target); - return JIM_ERR; + return retval; } } /* create the target specific commands */ if (target->type->commands) { - e = register_commands(cmd_ctx, NULL, target->type->commands); - if (e != ERROR_OK) - LOG_ERROR("unable to register '%s' commands", cp); + retval = register_commands(CMD_CTX, NULL, target->type->commands); + if (retval != ERROR_OK) + LOG_ERROR("unable to register '%s' commands", CMD_ARGV[0]); } /* now - create the new target name command */ @@ -5881,7 +5876,7 @@ static int target_create(struct jim_getopt_info *goi) }; const struct command_registration target_commands[] = { { - .name = cp, + .name = CMD_ARGV[0], .mode = COMMAND_ANY, .help = "target command group", .usage = "", @@ -5889,8 +5884,8 @@ static int target_create(struct jim_getopt_info *goi) }, COMMAND_REGISTRATION_DONE }; - e = register_commands_override_target(cmd_ctx, NULL, target_commands, target); - if (e != ERROR_OK) { + retval = register_commands_override_target(CMD_CTX, NULL, target_commands, target); + if (retval != ERROR_OK) { if (target->type->deinit_target) target->type->deinit_target(target); free(target->cmd_name); @@ -5899,14 +5894,14 @@ static int target_create(struct jim_getopt_info *goi) free(target->trace_info); free(target->type); free(target); - return JIM_ERR; + return retval; } /* append to end of list */ append_to_list_all_targets(target); - cmd_ctx->current_target = target; - return JIM_OK; + CMD_CTX->current_target = target; + return ERROR_OK; } COMMAND_HANDLER(handle_target_current) @@ -6027,18 +6022,6 @@ COMMAND_HANDLER(handle_target_smp) return retval; } -static int jim_target_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv) -{ - struct jim_getopt_info goi; - jim_getopt_setup(&goi, interp, argc - 1, argv + 1); - if (goi.argc < 3) { - Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv, - "<name> <target_type> [<target_options> ...]"); - return JIM_ERR; - } - return target_create(&goi); -} - static const struct command_registration target_subcommand_handlers[] = { { .name = "init", @@ -6050,7 +6033,7 @@ static const struct command_registration target_subcommand_handlers[] = { { .name = "create", .mode = COMMAND_CONFIG, - .jim_handler = jim_target_create, + .handler = handle_target_create, .usage = "name type '-chain-position' name [options ...]", .help = "Creates and selects a new target", }, commit 4a616ca4d83919fea03bf084ff326f584de558d7 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 18:40:47 2023 +0100 target: rewrite command 'invoke-event' as COMMAND_HANDLER The command shares with command 'target create' the struct jim_nvp nvp_target_event[] - Convert the 'struct jim_nvp' in 'struct nvp'. - Create an alias 'struct jim_nvp' to decouple the commands 'invoke-event' and 'target create', abusing the fact that the actual layout of the two struct's type is the same. This alias will be dropped in a following change. - Rewrite the command 'invoke-event' and the helper function target_event_name(). Change-Id: I537732fe4c08042cc02bcd0f72142254d7968fa6 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8826 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 36ad0eec8..3f16caaff 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -162,7 +162,7 @@ static const char *target_strerror_safe(int err) return n->name; } -static const struct jim_nvp nvp_target_event[] = { +static const struct nvp nvp_target_event[] = { { .value = TARGET_EVENT_GDB_HALT, .name = "gdb-halt" }, { .value = TARGET_EVENT_HALTED, .name = "halted" }, @@ -214,6 +214,8 @@ static const struct jim_nvp nvp_target_event[] = { { .name = NULL, .value = -1 } }; +static const struct jim_nvp *jim_nvp_target_event = (const struct jim_nvp *)nvp_target_event; + static const struct nvp nvp_target_state[] = { { .name = "unknown", .value = TARGET_UNKNOWN }, { .name = "running", .value = TARGET_RUNNING }, @@ -283,7 +285,7 @@ const char *target_state_name(const struct target *t) const char *target_event_name(enum target_event event) { const char *cp; - cp = jim_nvp_value2name_simple(nvp_target_event, event)->name; + cp = nvp_value2name(nvp_target_event, event)->name; if (!cp) { LOG_ERROR("Invalid target event: %d", (int)(event)); cp = "(*BUG*unknown*BUG*)"; @@ -4932,9 +4934,9 @@ no_params: return JIM_ERR; } - e = jim_getopt_nvp(goi, nvp_target_event, &n); + e = jim_getopt_nvp(goi, jim_nvp_target_event, &n); if (e != JIM_OK) { - jim_getopt_nvp_unknown(goi, nvp_target_event, 1); + jim_getopt_nvp_unknown(goi, jim_nvp_target_event, 1); return e; } @@ -5469,26 +5471,20 @@ COMMAND_HANDLER(handle_target_debug_reason) return ERROR_OK; } -static int jim_target_invoke_event(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +COMMAND_HANDLER(handle_target_invoke_event) { - struct jim_getopt_info goi; - jim_getopt_setup(&goi, interp, argc - 1, argv + 1); - if (goi.argc != 1) { - const char *cmd_name = Jim_GetString(argv[0], NULL); - Jim_SetResultFormatted(goi.interp, "%s <eventname>", cmd_name); - return JIM_ERR; - } - struct jim_nvp *n; - int e = jim_getopt_nvp(&goi, nvp_target_event, &n); - if (e != JIM_OK) { - jim_getopt_nvp_unknown(&goi, nvp_target_event, 1); - return e; + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; + + const struct nvp *n = nvp_name2value(nvp_target_event, CMD_ARGV[0]); + if (!n->name) { + nvp_unknown_command_print(CMD, nvp_target_event, NULL, CMD_ARGV[0]); + return ERROR_COMMAND_ARGUMENT_INVALID; } - struct command_context *cmd_ctx = current_command_context(interp); - assert(cmd_ctx); - struct target *target = get_current_target(cmd_ctx); + + struct target *target = get_current_target(CMD_CTX); target_handle_event(target, n->value); - return JIM_OK; + return ERROR_OK; } static const struct command_registration target_instance_command_handlers[] = { @@ -5670,7 +5666,7 @@ static const struct command_registration target_instance_command_handlers[] = { { .name = "invoke-event", .mode = COMMAND_EXEC, - .jim_handler = jim_target_invoke_event, + .handler = handle_target_invoke_event, .help = "invoke handler for specified event", .usage = "event_name", }, ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 187 +++++++++++++++++++++++----------------------------- 1 file changed, 83 insertions(+), 104 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-19 09:22:02
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a1ecf0a03d9812c285618ed995ea818eba020be3 (commit) from cfed1f78db635b504e4d11da537e614adfd57d3f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a1ecf0a03d9812c285618ed995ea818eba020be3 Author: Antonio Borneo <bor...@gm...> Date: Sun Apr 6 01:20:44 2025 +0200 target: don't free working areas during 'configure -chain-position' Since commit ef1cfb23947b ("Duane Ellis: "target as an [tcl] object" feature.") merged in 2008, the commands: $target_name configure -chain-position ... target create ... -chain-position ... cause the allocated working area to be freed. There is no reason for this, it is probably caused by an incorrect copy/paste from the author. Drop the call to target_free_all_working_areas(). Change-Id: I61a9303afe7fee6953669218330635c0b965b20d Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8825 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 8c5c8e5e3..36ad0eec8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -5128,7 +5128,6 @@ no_params: return JIM_ERR; } - target_free_all_working_areas(target); e = jim_getopt_obj(goi, &o_t); if (e != JIM_OK) return e; ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-19 09:21:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via cfed1f78db635b504e4d11da537e614adfd57d3f (commit) from 16c5c1b353b06602d81a8a81f5243154a6c366cc (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cfed1f78db635b504e4d11da537e614adfd57d3f Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 5 17:04:43 2025 +0200 list: silent scan-build false positive With commit c023534e7b6f ("target: use list for target events") scan build incorrectly states that list_add() would be called with the field 'next' of the parameter 'head' (thus 'head->next') set to NULL. Then, list_add() would call linux_list_add() with the parameter 'next' set to NULL that will cause a NULL dereference. While this can really happen with broken code, it's not the case with the code from the change above. Add assert() in linux_list_add() to silent scan build on this false positive and to detect future incorrect use of the list. Change-Id: Iec7f3d70237312b646ac58f76ecaab2fa25eab41 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8824 Tested-by: jenkins diff --git a/src/helper/list.h b/src/helper/list.h index ba07f1556..89b8468ec 100644 --- a/src/helper/list.h +++ b/src/helper/list.h @@ -35,6 +35,7 @@ /* begin OpenOCD changes */ +#include <assert.h> #include <stddef.h> struct list_head { @@ -109,6 +110,9 @@ static inline void linux_list_add(struct list_head *new, struct list_head *prev, struct list_head *next) { + assert(next); + assert(prev); + next->prev = new; new->next = next; new->prev = prev; ----------------------------------------------------------------------- Summary of changes: src/helper/list.h | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-19 09:19:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 16c5c1b353b06602d81a8a81f5243154a6c366cc (commit) from 339763ed2d9a00ac1f2418403bd29c324d1c7e6e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 16c5c1b353b06602d81a8a81f5243154a6c366cc Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 17:34:57 2023 +0100 command: rewrite command 'capture' as COMMAND_HANDLER While there, use Jim_EvalObj() to execute the subcommand, so any error will correctly report the TCL file and the line number that have originated the error, instead of the silly: > capture {bogus command} command.c:703: Error: invalid command name "bogus" at file "command.c", line 703 Change-Id: Ic75a6146d6cedf49e808d98501fa1a7d4235b58a Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8587 Tested-by: jenkins diff --git a/src/helper/command.c b/src/helper/command.c index 923b091a8..218f0581e 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -31,8 +31,7 @@ #define __THIS__FILE__ "command.c" struct log_capture_state { - Jim_Interp *interp; - Jim_Obj *output; + char *output; }; static int unregister_command(struct command_context *context, @@ -59,73 +58,6 @@ void *jimcmd_privdata(Jim_Cmd *cmd) return cmd->isproc ? NULL : cmd->u.native.privData; } -static void tcl_output(void *privData, const char *file, unsigned int line, - const char *function, const char *string) -{ - struct log_capture_state *state = privData; - Jim_AppendString(state->interp, state->output, string, strlen(string)); -} - -static struct log_capture_state *command_log_capture_start(Jim_Interp *interp) -{ - /* capture log output and return it. A garbage collect can - * happen, so we need a reference count to this object */ - Jim_Obj *jim_output = Jim_NewStringObj(interp, "", 0); - if (!jim_output) - return NULL; - - Jim_IncrRefCount(jim_output); - - struct log_capture_state *state = malloc(sizeof(*state)); - if (!state) { - LOG_ERROR("Out of memory"); - Jim_DecrRefCount(interp, jim_output); - return NULL; - } - - state->interp = interp; - state->output = jim_output; - - log_add_callback(tcl_output, state); - - return state; -} - -/* Classic openocd commands provide progress output which we - * will capture and return as a Tcl return value. - * - * However, if a non-openocd command has been invoked, then it - * makes sense to return the tcl return value from that command. - * - * The tcl return value is empty for openocd commands that provide - * progress output. - * - * For other commands, we prepend the logs to the tcl return value. - */ -static void command_log_capture_finish(struct log_capture_state *state) -{ - if (!state) - return; - - log_remove_callback(tcl_output, state); - - int loglen; - const char *log_result = Jim_GetString(state->output, &loglen); - int reslen; - const char *cmd_result = Jim_GetString(Jim_GetResult(state->interp), &reslen); - - // Just in case the log doesn't end with a newline, we add it - if (loglen != 0 && reslen != 0 && log_result[loglen - 1] != '\n') - Jim_AppendString(state->interp, state->output, "\n", 1); - - Jim_AppendString(state->interp, state->output, cmd_result, reslen); - - Jim_SetResult(state->interp, state->output); - Jim_DecrRefCount(state->interp, state->output); - - free(state); -} - static int command_retval_set(Jim_Interp *interp, int retval) { int *return_retval = Jim_GetAssocData(interp, "retval"); @@ -680,15 +612,28 @@ COMMAND_HANDLER(handle_echo) return ERROR_OK; } -/* Return both the progress output (LOG_INFO and higher) +static void tcl_output(void *privData, const char *file, unsigned int line, + const char *function, const char *string) +{ + struct log_capture_state *state = privData; + char *old = state->output; + + state->output = alloc_printf("%s%s", old ? old : "", string); + free(old); + if (!state->output) + LOG_ERROR("Out of memory"); +} + +/* + * Return both the progress output (LOG_INFO and higher) * and the tcl return value of a command. */ -static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +COMMAND_HANDLER(handle_command_capture) { - if (argc != 2) - return JIM_ERR; + struct log_capture_state state = {NULL}; - struct log_capture_state *state = command_log_capture_start(interp); + if (CMD_ARGC != 1) + return ERROR_COMMAND_SYNTAX_ERROR; /* disable polling during capture. This avoids capturing output * from polling. @@ -698,14 +643,24 @@ static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv) */ bool save_poll_mask = jtag_poll_mask(); - const char *str = Jim_GetString(argv[1], NULL); - int retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__); + log_add_callback(tcl_output, &state); + + int jimretval = Jim_EvalObj(CMD_CTX->interp, CMD_JIMTCL_ARGV[0]); + const char *cmd_result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), NULL); + + log_remove_callback(tcl_output, &state); jtag_poll_unmask(save_poll_mask); - command_log_capture_finish(state); + if (state.output && *state.output) + command_print(CMD, "%s", state.output); + + if (cmd_result && *cmd_result) + command_print(CMD, "%s", cmd_result); + + free(state.output); - return retcode; + return (jimretval == JIM_OK) ? ERROR_OK : ERROR_FAIL; } struct help_entry { @@ -1133,7 +1088,7 @@ static const struct command_registration command_builtin_handlers[] = { { .name = "capture", .mode = COMMAND_ANY, - .jim_handler = jim_capture, + .handler = handle_command_capture, .help = "Capture progress output and return as tcl return value. If the " "progress output was empty, return tcl return value.", .usage = "command", ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 113 ++++++++++++++++----------------------------------- 1 file changed, 34 insertions(+), 79 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-19 09:18:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 339763ed2d9a00ac1f2418403bd29c324d1c7e6e (commit) from 6834f022b96fb1c7f5829166578e01a0ac223cb0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 339763ed2d9a00ac1f2418403bd29c324d1c7e6e Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 17:06:17 2023 +0100 command: rewrite command 'command mode' as COMMAND_HANDLER Another step to drop jim_handler. Change-Id: I85cb567386a5aceb36aa273f8b66cbfd4a637c3f Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8586 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evg...@sy...> diff --git a/src/helper/command.c b/src/helper/command.c index 3d4379d06..923b091a8 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -843,22 +843,19 @@ COMMAND_HANDLER(handle_help_command) return retval; } -static char *alloc_concatenate_strings(int argc, Jim_Obj * const *argv) +static char *alloc_concatenate_strings(int argc, const char **argv) { - char *prev, *all; - int i; - assert(argc >= 1); - all = strdup(Jim_GetString(argv[0], NULL)); + char *all = strdup(argv[0]); if (!all) { LOG_ERROR("Out of memory"); return NULL; } - for (i = 1; i < argc; ++i) { - prev = all; - all = alloc_printf("%s %s", all, Jim_GetString(argv[i], NULL)); + for (int i = 1; i < argc; ++i) { + char *prev = all; + all = alloc_printf("%s %s", all, argv[i]); free(prev); if (!all) { LOG_ERROR("Out of memory"); @@ -944,17 +941,16 @@ static enum command_mode get_command_mode(Jim_Interp *interp, const char *cmd_na return c->mode; } -static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +COMMAND_HANDLER(handle_command_mode) { - struct command_context *cmd_ctx = current_command_context(interp); - enum command_mode mode = cmd_ctx->mode; + enum command_mode mode = CMD_CTX->mode; - if (argc > 1) { - char *full_name = alloc_concatenate_strings(argc - 1, argv + 1); + if (CMD_ARGC) { + char *full_name = alloc_concatenate_strings(CMD_ARGC, CMD_ARGV); if (!full_name) - return JIM_ERR; + return ERROR_FAIL; - mode = get_command_mode(interp, full_name); + mode = get_command_mode(CMD_CTX->interp, full_name); free(full_name); } @@ -975,8 +971,8 @@ static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) mode_str = "unknown"; break; } - Jim_SetResultString(interp, mode_str, -1); - return JIM_OK; + command_print(CMD, "%s", mode_str); + return ERROR_OK; } int help_del_all_commands(struct command_context *cmd_ctx) @@ -1115,7 +1111,7 @@ static const struct command_registration command_subcommand_handlers[] = { { .name = "mode", .mode = COMMAND_ANY, - .jim_handler = jim_command_mode, + .handler = handle_command_mode, .usage = "[command_name ...]", .help = "Returns the command modes allowed by a command: " "'any', 'config', or 'exec'. If no command is " ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-05 06:26:04
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 6834f022b96fb1c7f5829166578e01a0ac223cb0 (commit) from e45d66fd9a2f43ddc106957ca141f8734dc757a5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6834f022b96fb1c7f5829166578e01a0ac223cb0 Author: Sofiane HAMAM <sof...@sm...> Date: Fri Mar 28 12:31:17 2025 +0100 Makefile.am: Use SOURCE_DATE_EPOCH environment variable This package defines PKGBLDDATE as build timestamp which makes it non reproducible. Use SOURCE_DATE_EPOCH if it is found, otherwise use build timestamp. Following best practices, see : https://reproducible-builds.org/docs/source-date-epoch/ The patch is BSD compatible too. Change-Id: I26c1a00f2e8059ae31fe72a794b5962af5a84f44 Co-developed-by: Yoann Congal <yoa...@sm...> Signed-off-by: Yoann Congal <yoa...@sm...> Signed-off-by: Sofiane HAMAM <sof...@sm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8619 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Paul Fertser <fer...@gm...> Tested-by: jenkins diff --git a/src/Makefile.am b/src/Makefile.am index 4d1c1a250..4dbe93fee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -34,7 +34,10 @@ if RELEASE else %C%_libopenocd_la_CPPFLAGS += -DRELSTR=\"`$(top_srcdir)/guess-rev.sh $(top_srcdir)`\" %C%_libopenocd_la_CPPFLAGS += -DGITVERSION=\"`cd $(top_srcdir) && git describe`\" -%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`date +%F-%R`\" +%C%_libopenocd_la_CPPFLAGS += -DPKGBLDDATE=\"`DATE_FMT=+%F-%R; \ + SOURCE_DATE_EPOCH="$${SOURCE_DATE_EPOCH:-$$(date +%s)}"; \ + date -u -d "@$$SOURCE_DATE_EPOCH" "$$DATE_FMT" 2>/dev/null || \ + date -u -r "$$SOURCE_DATE_EPOCH" "$$DATE_FMT" 2>/dev/null || date -u "$$DATE_FMT"`\" endif # add default CPPFLAGS ----------------------------------------------------------------------- Summary of changes: src/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-05 06:25:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via e45d66fd9a2f43ddc106957ca141f8734dc757a5 (commit) from 9eb2426411aa0c1c13f5fc59801ac3cb3319f476 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e45d66fd9a2f43ddc106957ca141f8734dc757a5 Author: R. Diez <rdi...@ya...> Date: Sat Mar 22 23:35:23 2025 +0100 configure.ac: show the rshim adapter in the config summary Also enable this adapter by default (auto). Change-Id: Ic302041ecb9e88ca58b03f9675fa92fb3d558821 Signed-off-by: R. Diez <rdi...@ya...> Reviewed-on: https://review.openocd.org/c/openocd/+/8811 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/configure.ac b/configure.ac index b63c70e1f..84ca03bf0 100644 --- a/configure.ac +++ b/configure.ac @@ -187,6 +187,9 @@ m4_define([JTAG_DPI_ADAPTER], m4_define([JTAG_VPI_ADAPTER], [[[jtag_vpi], [JTAG VPI Adapter], [JTAG_VPI]]]) +m4_define([RSHIM_ADAPTER], + [[[rshim], [BlueField SoC via rshim], [RSHIM]]]) + # The word 'Adapter' in "Dummy Adapter" below must begin with a capital letter # because there is an M4 macro called 'adapter'. m4_define([DUMMY_ADAPTER], @@ -285,10 +288,6 @@ AS_IF([test "x$debug_malloc" = "xyes" -a "x$have_glibc" = "xyes"], [ AC_DEFINE([_DEBUG_FREE_SPACE_],[1], [Include malloc free space in logging]) ]) -AC_ARG_ENABLE([rshim], - AS_HELP_STRING([--enable-rshim], [Enable building the rshim driver]), - [build_rshim=$enableval], [build_rshim=no]) - AC_ARG_ENABLE([dmem], AS_HELP_STRING([--enable-dmem], [Enable building the dmem driver]), [build_dmem=$enableval], [build_dmem=no]) @@ -320,6 +319,7 @@ AC_ARG_ADAPTERS([ VDEBUG_ADAPTER, JTAG_DPI_ADAPTER, JTAG_VPI_ADAPTER, + RSHIM_ADAPTER, PCIE_ADAPTERS, LIBJAYLINK_ADAPTERS ],[auto]) @@ -383,19 +383,24 @@ AC_ARG_ENABLE([sysfsgpio], AS_HELP_STRING([--enable-sysfsgpio], [Enable building support for programming driven via sysfs gpios.]), [build_sysfsgpio=$enableval], [build_sysfsgpio=no]) +can_build_rshim=no + AS_CASE([$host_os], [linux*], [ is_linux=yes + can_build_rshim=yes ], [ AS_IF([test "x$build_sysfsgpio" = "xyes"], [ AC_MSG_ERROR([sysfsgpio is only available on linux]) ]) - AS_CASE([$host_os], [freebsd*], [], + AS_CASE([$host_os], [freebsd*], [ + can_build_rshim=yes + ], [ - AS_IF([test "x$build_rshim" = "xyes"], [ - AC_MSG_ERROR([build_rshim is only available on linux or freebsd]) + AS_IF([test "x$enable_rshim" = "xyes"], [ + AC_MSG_ERROR([rshim is only available on linux or freebsd]) ]) ]) @@ -514,12 +519,6 @@ AS_IF([test "x$build_parport" = "xyes"], [ AC_DEFINE([BUILD_PARPORT], [0], [0 if you don't want parport.]) ]) -AS_IF([test "x$build_rshim" = "xyes"], [ - AC_DEFINE([BUILD_RSHIM], [1], [1 if you want to debug BlueField SoC via rshim.]) -], [ - AC_DEFINE([BUILD_RSHIM], [0], [0 if you don't want to debug BlueField SoC via rshim.]) -]) - AS_IF([test "x$build_dmem" = "xyes"], [ AC_DEFINE([BUILD_DMEM], [1], [1 if you want to debug via Direct Mem.]) ], [ @@ -718,6 +717,8 @@ PROCESS_ADAPTERS([LINUXSPIDEV_ADAPTER], ["x$is_linux" = "xyes"], [Linux spidev]) PROCESS_ADAPTERS([VDEBUG_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([JTAG_DPI_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([JTAG_VPI_ADAPTER], [true], [unused]) +PROCESS_ADAPTERS([RSHIM_ADAPTER], ["x$can_build_rshim" = "xyes"], + [internal error: validation should happen beforehand]) PROCESS_ADAPTERS([DUMMY_ADAPTER], [true], [unused]) AS_IF([test "x$enable_linuxgpiod" != "xno"], [ @@ -783,7 +784,6 @@ AM_CONDITIONAL([USE_LIBFTDI], [test "x$use_libftdi" = "xyes"]) AM_CONDITIONAL([USE_LIBGPIOD], [test "x$use_libgpiod" = "xyes"]) AM_CONDITIONAL([USE_HIDAPI], [test "x$use_hidapi" = "xyes"]) AM_CONDITIONAL([USE_LIBJAYLINK], [test "x$use_libjaylink" = "xyes"]) -AM_CONDITIONAL([RSHIM], [test "x$build_rshim" = "xyes"]) AM_CONDITIONAL([DMEM], [test "x$build_dmem" = "xyes"]) AM_CONDITIONAL([HAVE_CAPSTONE], [test "x$enable_capstone" != "xno"]) @@ -876,6 +876,7 @@ m4_foreach([adapter], [USB1_ADAPTERS, VDEBUG_ADAPTER, JTAG_DPI_ADAPTER, JTAG_VPI_ADAPTER, + RSHIM_ADAPTER, DUMMY_ADAPTER, OPTIONAL_LIBRARIES, COVERAGE], ----------------------------------------------------------------------- Summary of changes: configure.ac | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-05 06:25:08
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9eb2426411aa0c1c13f5fc59801ac3cb3319f476 (commit) from 160f7b3e5d9aa78dbbb6eff63681621aed712ab6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9eb2426411aa0c1c13f5fc59801ac3cb3319f476 Author: R. Diez <rdi...@ya...> Date: Sun Mar 23 22:04:20 2025 +0100 configure.ac: show the Remote Bitbang driver in the config summary Also enable this driver by default (auto). Change-Id: I112d6c8c0796d0dc464651feb1f7f81fa8b93910 Signed-off-by: R. Diez <rdi...@ya...> Reviewed-on: https://review.openocd.org/c/openocd/+/8817 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/configure.ac b/configure.ac index 75c8e5d8a..b63c70e1f 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,9 @@ m4_define([LIBFTDI_USB1_ADAPTERS], m4_define([LIBGPIOD_ADAPTERS], [[[linuxgpiod], [Linux GPIO bitbang through libgpiod], [LINUXGPIOD]]]) +m4_define([REMOTE_BITBANG_ADAPTER], + [[[remote_bitbang], [Remote Bitbang driver], [REMOTE_BITBANG]]]) + m4_define([LIBJAYLINK_ADAPTERS], [[[jlink], [SEGGER J-Link Programmer], [JLINK]]]) @@ -310,6 +313,7 @@ AC_ARG_ADAPTERS([ LIBFTDI_ADAPTERS, LIBFTDI_USB1_ADAPTERS, LIBGPIOD_ADAPTERS, + REMOTE_BITBANG_ADAPTER, LINUXSPIDEV_ADAPTER, SERIAL_PORT_ADAPTERS, DUMMY_ADAPTER, @@ -413,10 +417,6 @@ AC_ARG_ENABLE([internal-libjaylink], [Enable building internal libjaylink]), [use_internal_libjaylink=$enableval], [use_internal_libjaylink=no]) -AC_ARG_ENABLE([remote-bitbang], - AS_HELP_STRING([--enable-remote-bitbang], [Enable building support for the Remote Bitbang driver]), - [build_remote_bitbang=$enableval], [build_remote_bitbang=no]) - AS_CASE(["${host_cpu}"], [i?86|x86*], [], [ @@ -611,13 +611,6 @@ AS_IF([test "x$use_internal_jimtcl" = "xyes"], [ ]) ]) -AS_IF([test "x$build_remote_bitbang" = "xyes"], [ - build_bitbang=yes - AC_DEFINE([BUILD_REMOTE_BITBANG], [1], [1 if you want the Remote Bitbang driver.]) -], [ - AC_DEFINE([BUILD_REMOTE_BITBANG], [0], [0 if you don't want the Remote Bitbang driver.]) -]) - AS_IF([test "x$build_sysfsgpio" = "xyes"], [ build_bitbang=yes AC_DEFINE([BUILD_SYSFSGPIO], [1], [1 if you want the SysfsGPIO driver.]) @@ -716,6 +709,7 @@ PROCESS_ADAPTERS([HIDAPI_USB1_ADAPTERS], ["x$use_hidapi" = "xyes" -a "x$use_libu PROCESS_ADAPTERS([LIBFTDI_ADAPTERS], ["x$use_libftdi" = "xyes"], [libftdi]) PROCESS_ADAPTERS([LIBFTDI_USB1_ADAPTERS], ["x$use_libftdi" = "xyes" -a "x$use_libusb1" = "xyes"], [libftdi and libusb-1.x]) PROCESS_ADAPTERS([LIBGPIOD_ADAPTERS], ["x$use_libgpiod" = "xyes"], [Linux libgpiod]) +PROCESS_ADAPTERS([REMOTE_BITBANG_ADAPTER], [true], [unused]) PROCESS_ADAPTERS([LIBJAYLINK_ADAPTERS], ["x$use_internal_libjaylink" = "xyes" -o "x$use_libjaylink" = "xyes"], [libjaylink-0.2]) PROCESS_ADAPTERS([PCIE_ADAPTERS], ["x$is_linux" = "xyes"], [Linux build]) PROCESS_ADAPTERS([SERIAL_PORT_ADAPTERS], ["x$can_build_buspirate" = "xyes"], @@ -730,6 +724,10 @@ AS_IF([test "x$enable_linuxgpiod" != "xno"], [ build_bitbang=yes ]) +AS_IF([test "x$enable_remote_bitbang" != "xno"], [ + build_bitbang=yes +]) + AS_IF([test "x$enable_stlink" != "xno" -o "x$enable_ti_icdi" != "xno" -o "x$enable_nulink" != "xno"], [ AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.]) AM_CONDITIONAL([HLADAPTER], [true]) @@ -774,7 +772,6 @@ AM_CONDITIONAL([BITBANG], [test "x$build_bitbang" = "xyes"]) AM_CONDITIONAL([USB_BLASTER_DRIVER], [test "x$enable_usb_blaster" != "xno" -o "x$enable_usb_blaster_2" != "xno"]) AM_CONDITIONAL([AMTJTAGACCEL], [test "x$build_amtjtagaccel" = "xyes"]) AM_CONDITIONAL([GW16012], [test "x$build_gw16012" = "xyes"]) -AM_CONDITIONAL([REMOTE_BITBANG], [test "x$build_remote_bitbang" = "xyes"]) AM_CONDITIONAL([SYSFSGPIO], [test "x$build_sysfsgpio" = "xyes"]) AM_CONDITIONAL([USE_LIBUSB1], [test "x$use_libusb1" = "xyes"]) AM_CONDITIONAL([IS_CYGWIN], [test "x$is_cygwin" = "xyes"]) @@ -873,6 +870,7 @@ m4_foreach([adapter], [USB1_ADAPTERS, HIDAPI_ADAPTERS, HIDAPI_USB1_ADAPTERS, LIBFTDI_ADAPTERS, LIBFTDI_USB1_ADAPTERS, LIBGPIOD_ADAPTERS, + REMOTE_BITBANG_ADAPTER, LIBJAYLINK_ADAPTERS, PCIE_ADAPTERS, SERIAL_PORT_ADAPTERS, LINUXSPIDEV_ADAPTER, VDEBUG_ADAPTER, ----------------------------------------------------------------------- Summary of changes: configure.ac | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-05 06:24:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 160f7b3e5d9aa78dbbb6eff63681621aed712ab6 (commit) via c023534e7b6f61dddf91fc6ca4644d4071bb73dc (commit) from 04124c77f48b9748b88b4ccf77a36665855ee73e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 160f7b3e5d9aa78dbbb6eff63681621aed712ab6 Author: Antonio Borneo <bor...@gm...> Date: Sun Mar 23 15:27:37 2025 +0100 target: remove events that are set to empty string Current code allows replacing the body of an existing event, but it doesn't provides a way to remove it. Replacing the event with an empty string makes the event still present and visible through $target_name eventlist The presence of empty events makes more complex checking for the event not set or set to empty. Remove the event when set to empty string. While there, add 'Jim_Length' to the list of allowed CamelCase symbols, avoiding the associated checkpatch error. Change-Id: I1ec2e1a71d298a0eba0b6863902645bcc6c4cb09 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8814 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 53850bf28..8c5c8e5e3 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4968,6 +4968,17 @@ no_params: LOG_INFO("DEPRECATED target event %s; use TPIU events {pre,post}-{enable,disable}", n->name); /* END_DEPRECATED_TPIU */ + jim_getopt_obj(goi, &o); + if (Jim_Length(o) == 0) { + /* empty action, drop existing one */ + if (teap) { + list_del(&teap->list); + Jim_DecrRefCount(teap->interp, teap->body); + free(teap); + } + break; + } + bool replace = true; if (!teap) { /* create new */ @@ -4976,7 +4987,6 @@ no_params: } teap->event = n->value; teap->interp = goi->interp; - jim_getopt_obj(goi, &o); if (teap->body) Jim_DecrRefCount(teap->interp, teap->body); teap->body = Jim_DuplicateObj(goi->interp, o); diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt index b78790200..6c6c28daa 100644 --- a/tools/scripts/camelcase.txt +++ b/tools/scripts/camelcase.txt @@ -122,6 +122,7 @@ Jim_GetWide Jim_IncrRefCount Jim_InitStaticExtensions Jim_Interp +Jim_Length Jim_ListAppendElement Jim_ListGetIndex Jim_ListLength commit c023534e7b6f61dddf91fc6ca4644d4071bb73dc Author: Antonio Borneo <bor...@gm...> Date: Sun Mar 23 12:09:28 2025 +0100 target: use list for target events To simplify removing an event when it's set to an empty string, switch event list from hardcoded simply linked list to helper's double linked list. While there, move the declaration of struct target_event_action in 'target.c' as it is not anymore visible outside. Change-Id: I799754c80055dc6d22db55aca483757e833714ff Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8813 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 3b62e0db0..53850bf28 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -31,6 +31,7 @@ #endif #include <helper/align.h> +#include <helper/list.h> #include <helper/nvp.h> #include <helper/time_support.h> #include <jtag/jtag.h> @@ -52,6 +53,13 @@ /* default halt wait timeout (ms) */ #define DEFAULT_HALT_TIMEOUT 5000 +struct target_event_action { + enum target_event event; + Jim_Interp *interp; + Jim_Obj *body; + struct list_head list; +}; + static int target_read_buffer_default(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer); static int target_write_buffer_default(struct target *target, target_addr_t address, @@ -2194,12 +2202,11 @@ static void target_destroy(struct target *target) jtag_unregister_event_callback(jtag_enable_callback, target); - struct target_event_action *teap = target->event_action; - while (teap) { - struct target_event_action *next = teap->next; + struct target_event_action *teap, *temp; + list_for_each_entry_safe(teap, temp, &target->events_action, list) { + list_del(&teap->list); Jim_DecrRefCount(teap->interp, teap->body); free(teap); - teap = next; } target_free_all_working_areas(target); @@ -4663,7 +4670,7 @@ void target_handle_event(struct target *target, enum target_event e) struct target_event_action *teap; int retval; - for (teap = target->event_action; teap; teap = teap->next) { + list_for_each_entry(teap, &target->events_action, list) { if (teap->event == e) { LOG_DEBUG("target: %s (%s) event: %d (%s) action: %s", target_name(target), @@ -4826,7 +4833,7 @@ bool target_has_event_action(const struct target *target, enum target_event even { struct target_event_action *teap; - for (teap = target->event_action; teap; teap = teap->next) { + list_for_each_entry(teap, &target->events_action, list) { if (teap->event == event) return true; } @@ -4946,13 +4953,14 @@ no_params: { struct target_event_action *teap; - teap = target->event_action; /* replace existing? */ - while (teap) { + list_for_each_entry(teap, &target->events_action, list) if (teap->event == (enum target_event)n->value) break; - teap = teap->next; - } + + /* not found! */ + if (&teap->list == &target->events_action) + teap = NULL; if (goi->is_configure) { /* START_DEPRECATED_TPIU */ @@ -4986,8 +4994,7 @@ no_params: if (!replace) { /* add to head of event list */ - teap->next = target->event_action; - target->event_action = teap; + list_add(&teap->list, &target->events_action); } Jim_SetEmptyResult(goi->interp); } else { @@ -5402,19 +5409,19 @@ COMMAND_HANDLER(handle_target_wait_state) COMMAND_HANDLER(handle_target_event_list) { struct target *target = get_current_target(CMD_CTX); - struct target_event_action *teap = target->event_action; + struct target_event_action *teap; command_print(CMD, "Event actions for target %s\n", target_name(target)); command_print(CMD, "%-25s | Body", "Event"); command_print(CMD, "------------------------- | " "----------------------------------------"); - while (teap) { + + list_for_each_entry(teap, &target->events_action, list) command_print(CMD, "%-25s | %s", target_event_name(teap->event), Jim_GetString(teap->body, NULL)); - teap = teap->next; - } + command_print(CMD, "***END***"); return ERROR_OK; } @@ -5767,6 +5774,8 @@ static int target_create(struct jim_getopt_info *goi) target->halt_issued = false; + INIT_LIST_HEAD(&target->events_action); + /* initialize trace information */ target->trace_info = calloc(1, sizeof(struct trace)); if (!target->trace_info) { diff --git a/src/target/target.h b/src/target/target.h index 47f02ec26..b698f250c 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -139,7 +139,7 @@ struct target { */ bool running_alg; - struct target_event_action *event_action; + struct list_head events_action; bool reset_halt; /* attempt resetting the CPU into the halted mode? */ target_addr_t working_area; /* working area (initialised RAM). Evaluated @@ -295,13 +295,6 @@ enum target_event { TARGET_EVENT_SEMIHOSTING_USER_CMD_0X107 = 0x107, }; -struct target_event_action { - enum target_event event; - Jim_Interp *interp; - Jim_Obj *body; - struct target_event_action *next; -}; - bool target_has_event_action(const struct target *target, enum target_event event); struct target_event_callback { ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 53 ++++++++++++++++++++++++++++++--------------- src/target/target.h | 9 +------- tools/scripts/camelcase.txt | 1 + 3 files changed, 38 insertions(+), 25 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-05 06:23:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 04124c77f48b9748b88b4ccf77a36665855ee73e (commit) from 169d463a3d3c91f62c980aba287b5e110b310ad0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 04124c77f48b9748b88b4ccf77a36665855ee73e Author: Antonio Borneo <bor...@gm...> Date: Sat Mar 29 22:51:59 2025 +0100 target: fix memory leak in handle_target_write_memory() Commit f55ec6d44922 ("target: rewrite command 'write_memory' as COMMAND_HANDLER") adds a new return statement without freeing the allocated buffer. Add the needed free(). Fixes: f55ec6d44922 ("target: rewrite command 'write_memory' as COMMAND_HANDLER") Change-Id: I676d658118b32f4d7cc71eda3436bb52f1966cd8 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8822 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index 7baeeddd0..3b62e0db0 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4608,6 +4608,7 @@ COMMAND_HANDLER(handle_target_write_memory) int jimretval = Jim_GetWide(CMD_CTX->interp, tmp, &element_wide); if (jimretval != JIM_OK) { command_print(CMD, "invalid value \"%s\"", Jim_GetString(tmp, NULL)); + free(buffer); return ERROR_COMMAND_ARGUMENT_INVALID; } ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-04-01 04:51:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 169d463a3d3c91f62c980aba287b5e110b310ad0 (commit) from fe3aa0a4bc185828cb318715b055dc64518bd9eb (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 169d463a3d3c91f62c980aba287b5e110b310ad0 Author: Tomas Vanek <va...@fb...> Date: Tue Feb 11 17:59:00 2025 +0100 tcl/target/nordic/nrf54l: minor corrections Add SWD multidrop setting. Fix the name of AP #1 to AUX-AP Set AUX-AP CSW Prot bit[0] to make RISC-V debug accessible on AUX-AP. Change-Id: I496e07acfe90dd858e4403176a8330d8c1a0b560 Signed-off-by: Tomas Vanek <va...@fb...> Reviewed-on: https://review.openocd.org/c/openocd/+/8752 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/tcl/target/nordic/nrf54l.cfg b/tcl/target/nordic/nrf54l.cfg index 70ead1365..3e14055f1 100644 --- a/tcl/target/nordic/nrf54l.cfg +++ b/tcl/target/nordic/nrf54l.cfg @@ -27,18 +27,35 @@ if { [info exists CPUTAPID] } { set _CPUTAPID 0x6ba02477 } +# Multidrop instance ID should be configurable by FW in TAD TINSTANCE register. +# Writes to the register are ignored due to a silicon erratum. +if { [info exists SWD_INSTANCE_ID] } { + set _SWD_INSTANCE_ID $SWD_INSTANCE_ID +} else { + set _SWD_INSTANCE_ID 0 +} + transport select swd swd newdap $_CHIPNAME cpu -expected-id $_CPUTAPID -dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu + +if { [info exists SWD_MULTIDROP] } { + dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu -dp-id 0x001c0289 -instance-id $_SWD_INSTANCE_ID +} else { + dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu +} set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap -ap-num 0 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 -# Create target for the control access port (CTRL-AP). -target create $_CHIPNAME.ctrl mem_ap -dap $_CHIPNAME.dap -ap-num 1 +# Create target for the AUX access port (AUX-AP). +target create $_CHIPNAME.aux mem_ap -dap $_CHIPNAME.dap -ap-num 1 + +# AUX-AP is accessible only if CSW Prot[0] bit (Data Access) is set +$_CHIPNAME.dap apsel 1 +$_CHIPNAME.dap apcsw 0x01000000 0x01000000 adapter speed 1000 ----------------------------------------------------------------------- Summary of changes: tcl/target/nordic/nrf54l.cfg | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 22:09:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via fe3aa0a4bc185828cb318715b055dc64518bd9eb (commit) from f885a8d76c96ec94e2f7a4c4fadd57dfe384a8ac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit fe3aa0a4bc185828cb318715b055dc64518bd9eb Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 15:04:09 2023 +0100 target: rewrite command 'get_reg' as COMMAND_HANDLER Print one register per line. Repeated registers will be printed each time. While there, fix the 'usage' string. Change-Id: I4eb21696705bdf15cd2cb7a4a9caa41f9ffdbf64 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8583 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evg...@sy...> diff --git a/src/target/target.c b/src/target/target.c index 2f736f0e8..7baeeddd0 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4701,63 +4701,46 @@ void target_handle_event(struct target *target, enum target_event e) } } -static int target_jim_get_reg(Jim_Interp *interp, int argc, - Jim_Obj * const *argv) +COMMAND_HANDLER(handle_target_get_reg) { - bool force = false; + if (CMD_ARGC < 1 || CMD_ARGC > 2) + return ERROR_COMMAND_SYNTAX_ERROR; - if (argc == 3) { - const char *option = Jim_GetString(argv[1], NULL); + bool force = false; + Jim_Obj *next_argv = CMD_JIMTCL_ARGV[0]; - if (!strcmp(option, "-force")) { - argc--; - argv++; - force = true; - } else { - Jim_SetResultFormatted(interp, "invalid option '%s'", option); - return JIM_ERR; + if (CMD_ARGC == 2) { + if (strcmp(CMD_ARGV[0], "-force")) { + command_print(CMD, "invalid argument '%s', must be '-force'", CMD_ARGV[0]); + return ERROR_COMMAND_ARGUMENT_INVALID; } - } - if (argc != 2) { - Jim_WrongNumArgs(interp, 1, argv, "[-force] list"); - return JIM_ERR; + force = true; + next_argv = CMD_JIMTCL_ARGV[1]; } - const int length = Jim_ListLength(interp, argv[1]); + const int length = Jim_ListLength(CMD_CTX->interp, next_argv); - Jim_Obj *result_dict = Jim_NewDictObj(interp, NULL, 0); - - if (!result_dict) - return JIM_ERR; - - struct command_context *cmd_ctx = current_command_context(interp); - assert(cmd_ctx); - const struct target *target = get_current_target(cmd_ctx); + const struct target *target = get_current_target(CMD_CTX); for (int i = 0; i < length; i++) { - Jim_Obj *elem = Jim_ListGetIndex(interp, argv[1], i); - - if (!elem) - return JIM_ERR; + Jim_Obj *elem = Jim_ListGetIndex(CMD_CTX->interp, next_argv, i); const char *reg_name = Jim_String(elem); - struct reg *reg = register_get_by_name(target->reg_cache, reg_name, - false); + struct reg *reg = register_get_by_name(target->reg_cache, reg_name, false); if (!reg || !reg->exist) { - Jim_SetResultFormatted(interp, "unknown register '%s'", reg_name); - return JIM_ERR; + command_print(CMD, "unknown register '%s'", reg_name); + return ERROR_COMMAND_ARGUMENT_INVALID; } if (force || !reg->valid) { int retval = reg->type->get(reg); if (retval != ERROR_OK) { - Jim_SetResultFormatted(interp, "failed to read register '%s'", - reg_name); - return JIM_ERR; + command_print(CMD, "failed to read register '%s'", reg_name); + return retval; } } @@ -4765,27 +4748,15 @@ static int target_jim_get_reg(Jim_Interp *interp, int argc, if (!reg_value) { LOG_ERROR("Failed to allocate memory"); - return JIM_ERR; + return ERROR_FAIL; } - char *tmp = alloc_printf("0x%s", reg_value); + command_print(CMD, "%s 0x%s", reg_name, reg_value); free(reg_value); - - if (!tmp) { - LOG_ERROR("Failed to allocate memory"); - return JIM_ERR; - } - - Jim_DictAddElement(interp, result_dict, elem, - Jim_NewStringObj(interp, tmp, -1)); - - free(tmp); } - Jim_SetResult(interp, result_dict); - - return JIM_OK; + return ERROR_OK; } COMMAND_HANDLER(handle_set_reg_command) @@ -5577,9 +5548,9 @@ static const struct command_registration target_instance_command_handlers[] = { { .name = "get_reg", .mode = COMMAND_EXEC, - .jim_handler = target_jim_get_reg, + .handler = handle_target_get_reg, .help = "Get register values from the target", - .usage = "list", + .usage = "[-force] list", }, { .name = "set_reg", @@ -6712,9 +6683,9 @@ static const struct command_registration target_exec_command_handlers[] = { { .name = "get_reg", .mode = COMMAND_EXEC, - .jim_handler = target_jim_get_reg, + .handler = handle_target_get_reg, .help = "Get register values from the target", - .usage = "list", + .usage = "[-force] list", }, { .name = "set_reg", ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 81 +++++++++++++++++------------------------------------ 1 file changed, 26 insertions(+), 55 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:27:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f885a8d76c96ec94e2f7a4c4fadd57dfe384a8ac (commit) from a9fa3392670659dfd558d8733911ffce9538e2d2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f885a8d76c96ec94e2f7a4c4fadd57dfe384a8ac Author: Adrien Grassein <agr...@na...> Date: Thu Jan 18 11:54:15 2024 +0100 target/aarch64: Cleanup on exit Restore target configuration on exit so that OpenOCD get correct values when restarting. Change-Id: I8cbba1fdae1d3c4a580197b7a97691443780ed06 Signed-off-by: Adrien Grassein <agr...@na...> Signed-off-by: Adrien Charruel <ach...@na...> Reviewed-on: https://review.openocd.org/c/openocd/+/8654 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/aarch64.c b/src/target/aarch64.c index 609965ba5..ce7808e3a 100644 --- a/src/target/aarch64.c +++ b/src/target/aarch64.c @@ -2857,6 +2857,14 @@ static void aarch64_deinit_target(struct target *target) struct aarch64_common *aarch64 = target_to_aarch64(target); struct armv8_common *armv8 = &aarch64->armv8_common; struct arm_dpm *dpm = &armv8->dpm; + uint64_t address; + + if (target->state == TARGET_HALTED) { + // Restore the previous state of the target (gp registers, MMU, caches, etc) + int retval = aarch64_restore_one(target, true, &address, false, false); + if (retval != ERROR_OK) + LOG_TARGET_ERROR(target, "Failed to restore target state"); + } if (armv8->debug_ap) dap_put_ap(armv8->debug_ap); ----------------------------------------------------------------------- Summary of changes: src/target/aarch64.c | 8 ++++++++ 1 file changed, 8 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:27:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a9fa3392670659dfd558d8733911ffce9538e2d2 (commit) from a86fdfc73548a2b317ed8e61a618ebff2ee4f5e2 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a9fa3392670659dfd558d8733911ffce9538e2d2 Author: Marek Vasut <mar...@gm...> Date: Fri Aug 23 01:29:12 2024 +0200 tcl/target: Add Renesas R-Car Gen4 R8A779G0 V4H and R8A779H0 V4M targets Add support for Renesas R-Car Gen4 R8A779G0 V4H and R8A779H0 V4M SoCs. Those contain 4x CA76 and 3x CR52 cores. Change-Id: I4a701f0fec4dd574fc099a221d464ccc55db6252 Signed-off-by: Marek Vasut <mar...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8807 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/tcl/target/renesas_rcar_gen3.cfg b/tcl/target/renesas_rcar_gen3.cfg index 73b3003a9..f6bc5e4c8 100644 --- a/tcl/target/renesas_rcar_gen3.cfg +++ b/tcl/target/renesas_rcar_gen3.cfg @@ -90,6 +90,18 @@ switch $_soc { set _num_cr52 1 set _boot_core CA76 } + V4H { + set _CHIPNAME r8a779g0 + set _num_ca76 4 + set _num_cr52 3 + set _boot_core CR52 + } + V4M { + set _CHIPNAME r8a779h0 + set _num_ca76 4 + set _num_cr52 3 + set _boot_core CR52 + } default { error "'$_soc' is invalid!" } @@ -126,8 +138,8 @@ set CA57_DBGBASE {0x80410000 0x80510000 0x80610000 0x80710000} set CA57_CTIBASE {0x80420000 0x80520000 0x80620000 0x80720000} set CA53_DBGBASE {0x80C10000 0x80D10000 0x80E10000 0x80F10000} set CA53_CTIBASE {0x80C20000 0x80D20000 0x80E20000 0x80F20000} -set CR52_DBGBASE 0x80c10000 -set CR52_CTIBASE 0x80c20000 +set CR52_DBGBASE {0x80C10000 0x80D10000 0x80E10000} +set CR52_CTIBASE {0x80C20000 0x80D20000 0x80E20000} set CR7_DBGBASE 0x80910000 set CR7_CTIBASE 0x80918000 @@ -159,24 +171,27 @@ proc setup_a5x {core_name dbgbase ctibase num boot} { proc setup_crx {core_name dbgbase ctibase num boot} { global _CHIPNAME global _DAPNAME + global smp_targets global _targets for { set _core 0 } { $_core < $num } { incr _core } { - set _TARGETNAME $_CHIPNAME.$core_name + set _TARGETNAME $_CHIPNAME.$core_name.$_core set _CTINAME $_TARGETNAME.cti - cti create $_CTINAME -dap $_DAPNAME -ap-num 1 -baseaddr $ctibase + cti create $_CTINAME -dap $_DAPNAME -ap-num 1 -baseaddr [lindex $ctibase $_core] if { $core_name == "r52" } { set _command "target create $_TARGETNAME armv8r -dap $_DAPNAME \ - -ap-num 1 -dbgbase $dbgbase -cti $_CTINAME" + -ap-num 1 -dbgbase [lindex $dbgbase $_core] -cti $_CTINAME" } else { set _command "target create $_TARGETNAME cortex_r4 -dap $_DAPNAME \ - -ap-num 1 -dbgbase $dbgbase" + -ap-num 1 -dbgbase [lindex $dbgbase $_core]" } - if { $boot == 1 } { + if { $_core == 0 && $boot == 1 } { set _targets "$_TARGETNAME" } else { set _command "$_command -defer-examine" } + set smp_targets "$smp_targets $_TARGETNAME" eval $_command + $_TARGETNAME configure -event examine-end { halt } } } ----------------------------------------------------------------------- Summary of changes: tcl/target/renesas_rcar_gen3.cfg | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:27:06
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via a86fdfc73548a2b317ed8e61a618ebff2ee4f5e2 (commit) from 5773ff9d82a06e7e270dd71fc3d4352815384292 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a86fdfc73548a2b317ed8e61a618ebff2ee4f5e2 Author: Antonio Borneo <bor...@gm...> Date: Sun Mar 16 11:50:04 2025 +0100 target: drop last instances of 'target->cmd_name' The helper function 'target_name()' or, better, the log functions 'LOG_TARGET_xxx(target, ...)' should be used in place of taking the target name directly from 'target->cmd_name'. Replace the remaining instances in the code. While there: - address some indentation, - drop trailing punctuation in log message, - replace one LOG WARNING with LOG_TARGET_WARNING. Change-Id: Ie6cf4c174ffe91b975c983e4697c735766267041 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8806 Tested-by: jenkins Reviewed-by: zapb <de...@za...> diff --git a/src/target/armv7a.c b/src/target/armv7a.c index e22d309a0..c14155e01 100644 --- a/src/target/armv7a.c +++ b/src/target/armv7a.c @@ -101,14 +101,14 @@ static int armv7a_read_midr(struct target *target) armv7a->arch = (midr >> 16) & 0xf; armv7a->variant = (midr >> 20) & 0xf; armv7a->implementor = (midr >> 24) & 0xff; - LOG_DEBUG("%s rev %" PRIx32 ", partnum %" PRIx32 ", arch %" PRIx32 - ", variant %" PRIx32 ", implementor %" PRIx32, - target->cmd_name, - armv7a->rev, - armv7a->partnum, - armv7a->arch, - armv7a->variant, - armv7a->implementor); + LOG_TARGET_DEBUG(target, + "rev %" PRIx32 ", partnum %" PRIx32 ", arch %" PRIx32 + ", variant %" PRIx32 ", implementor %" PRIx32, + armv7a->rev, + armv7a->partnum, + armv7a->arch, + armv7a->variant, + armv7a->implementor); done: dpm->finish(dpm); diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c index b32fec270..9c6064558 100644 --- a/src/target/cortex_a.c +++ b/src/target/cortex_a.c @@ -2923,14 +2923,12 @@ static int cortex_a_examine_first(struct target *target) armv7a->debug_ap->memaccess_tck = 80; if (!target->dbgbase_set) { - LOG_DEBUG("%s's dbgbase is not set, trying to detect using the ROM table", - target->cmd_name); + LOG_TARGET_DEBUG(target, "dbgbase is not set, trying to detect using the ROM table"); /* Lookup Processor DAP */ retval = dap_lookup_cs_component(armv7a->debug_ap, ARM_CS_C9_DEVTYPE_CORE_DEBUG, &armv7a->debug_base, target->coreid); if (retval != ERROR_OK) { - LOG_ERROR("Can't detect %s's dbgbase from the ROM table; you need to specify it explicitly.", - target->cmd_name); + LOG_TARGET_ERROR(target, "Can't detect dbgbase from the ROM table; you need to specify it explicitly"); return retval; } LOG_DEBUG("Detected core %" PRId32 " dbgbase: " TARGET_ADDR_FMT, @@ -2939,8 +2937,9 @@ static int cortex_a_examine_first(struct target *target) armv7a->debug_base = target->dbgbase; if ((armv7a->debug_base & (1UL<<31)) == 0) - LOG_WARNING("Debug base address for target %s has bit 31 set to 0. Access to debug registers will likely fail!\n" - "Please fix the target configuration.", target_name(target)); + LOG_TARGET_WARNING(target, + "Debug base address has bit 31 set to 0. Access to debug registers will likely fail!\n" + "Please fix the target configuration"); retval = mem_ap_read_atomic_u32(armv7a->debug_ap, armv7a->debug_base + CPUDBG_DIDR, &didr); diff --git a/src/target/espressif/esp32_apptrace.c b/src/target/espressif/esp32_apptrace.c index 3202fd3d6..307096019 100644 --- a/src/target/espressif/esp32_apptrace.c +++ b/src/target/espressif/esp32_apptrace.c @@ -649,7 +649,7 @@ static int esp32_apptrace_wait4halt(struct esp32_apptrace_cmd_ctx *ctx, struct t if (res != ERROR_OK) return res; if (target->state == TARGET_HALTED) { - LOG_USER("%s: HALTED", target->cmd_name); + LOG_TARGET_USER(target, "HALTED"); break; } alive_sleep(500); diff --git a/src/target/espressif/esp_xtensa_apptrace.c b/src/target/espressif/esp_xtensa_apptrace.c index 5741ab030..313f6ce77 100644 --- a/src/target/espressif/esp_xtensa_apptrace.c +++ b/src/target/espressif/esp_xtensa_apptrace.c @@ -277,7 +277,7 @@ static int esp_xtensa_swdbg_activate(struct target *target, int enab) xtensa_dm_queue_tdi_idle(&xtensa->dbg_mod); int res = xtensa_dm_queue_execute(&xtensa->dbg_mod); if (res != ERROR_OK) { - LOG_ERROR("%s: writing DCR failed!", target->cmd_name); + LOG_TARGET_ERROR(target, "writing DCR failed"); return res; } ----------------------------------------------------------------------- Summary of changes: src/target/armv7a.c | 16 ++++++++-------- src/target/cortex_a.c | 11 +++++------ src/target/espressif/esp32_apptrace.c | 2 +- src/target/espressif/esp_xtensa_apptrace.c | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:26:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 5773ff9d82a06e7e270dd71fc3d4352815384292 (commit) from 98e34fd1f17207ce30fd5c80ab9aefb28fbdc688 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5773ff9d82a06e7e270dd71fc3d4352815384292 Author: Adrien Grassein <agr...@na...> Date: Thu Jan 18 11:58:38 2024 +0100 target/armv8: Handle instruction cache invalidate Some armv8 target have separate i-cache and d-cache. The actual code only handles the flush of the d-cache. Change-Id: I61a223b43c71646bbbed8fa63825360c67700988 Signed-off-by: Adrien Grassein <agr...@na...> Signed-off-by: Adrien Charruel <ach...@na...> Reviewed-on: https://review.openocd.org/c/openocd/+/8655 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/armv8.h b/src/target/armv8.h index 49ab3e5cb..dba12f966 100644 --- a/src/target/armv8.h +++ b/src/target/armv8.h @@ -162,6 +162,7 @@ struct armv8_cache_common { /* l2 external unified cache if some */ void *l2_cache; int (*flush_all_data_cache)(struct target *target); + int (*invalidate_all_instruction_cache)(struct target *target); int (*display_cache_info)(struct command_invocation *cmd, struct armv8_cache_common *armv8_cache); }; diff --git a/src/target/armv8_cache.c b/src/target/armv8_cache.c index 74d063b0e..1c251beb9 100644 --- a/src/target/armv8_cache.c +++ b/src/target/armv8_cache.c @@ -141,6 +141,36 @@ done: return retval; } +static int armv8_cache_i_inner_clean_inval_all(struct armv8_common *armv8) +{ + struct arm_dpm *dpm = armv8->arm.dpm; + int retval; + + retval = armv8_i_cache_sanity_check(armv8); + if (retval != ERROR_OK) + return retval; + + LOG_DEBUG("flushing cache"); + + retval = dpm->prepare(dpm); + if (retval != ERROR_OK) + goto done; + + retval = dpm->instr_execute(dpm, armv8_opcode(armv8, ARMV8_OPC_ICIALLU)); + if (retval != ERROR_OK) + goto done; + + dpm->finish(dpm); + LOG_DEBUG("flushing cache done"); + return retval; + +done: + LOG_ERROR("i-cache invalidate failed"); + dpm->finish(dpm); + + return retval; +} + int armv8_cache_i_inner_inval_virt(struct armv8_common *armv8, target_addr_t va, size_t size) { struct arm_dpm *dpm = armv8->arm.dpm; @@ -253,6 +283,32 @@ static int armv8_flush_all_data(struct target *target) return retval; } +static int armv8_flush_all_instruction(struct target *target) +{ + int retval = ERROR_FAIL; + /* check that armv8_cache is correctly identify */ + struct armv8_common *armv8 = target_to_armv8(target); + if (armv8->armv8_mmu.armv8_cache.info == -1) { + LOG_ERROR("trying to flush un-identified cache"); + return retval; + } + + if (target->smp) { + /* look if all the other target have been flushed in order to flush icache */ + struct target_list *head; + foreach_smp_target(head, target->smp_targets) { + struct target *curr = head->target; + if (curr->state == TARGET_HALTED) { + LOG_TARGET_INFO(curr, "Wait flushing instruction l1."); + retval = armv8_cache_i_inner_clean_inval_all(target_to_armv8(curr)); + } + } + } else { + retval = armv8_cache_i_inner_clean_inval_all(armv8); + } + return retval; +} + static int get_cache_info(struct arm_dpm *dpm, int cl, int ct, uint32_t *cache_reg) { struct armv8_common *armv8 = dpm->arm->arch_info; @@ -412,6 +468,12 @@ int armv8_identify_cache(struct armv8_common *armv8) armv8->armv8_mmu.armv8_cache.flush_all_data_cache = armv8_flush_all_data; } + if (!armv8->armv8_mmu.armv8_cache.invalidate_all_instruction_cache) { + armv8->armv8_mmu.armv8_cache.display_cache_info = + armv8_handle_inner_cache_info_command; + armv8->armv8_mmu.armv8_cache.invalidate_all_instruction_cache = + armv8_flush_all_instruction; + } done: armv8_dpm_modeswitch(dpm, ARM_MODE_ANY); diff --git a/src/target/armv8_opcodes.c b/src/target/armv8_opcodes.c index 2635b3ec5..0f6c8108e 100644 --- a/src/target/armv8_opcodes.c +++ b/src/target/armv8_opcodes.c @@ -41,6 +41,7 @@ static const uint32_t a64_opcodes[ARMV8_OPC_NUM] = { [ARMV8_OPC_STRH_IP] = ARMV8_STRH_IP(1, 0), [ARMV8_OPC_STRW_IP] = ARMV8_STRW_IP(1, 0), [ARMV8_OPC_STRD_IP] = ARMV8_STRD_IP(1, 0), + [ARMV8_OPC_ICIALLU] = ARMV8_SYS(SYSTEM_ICIALLU, 0x1F), }; static const uint32_t t32_opcodes[ARMV8_OPC_NUM] = { @@ -68,6 +69,7 @@ static const uint32_t t32_opcodes[ARMV8_OPC_NUM] = { [ARMV8_OPC_STRB_IP] = ARMV8_STRB_IP_T3(1, 0), [ARMV8_OPC_STRH_IP] = ARMV8_STRH_IP_T3(1, 0), [ARMV8_OPC_STRW_IP] = ARMV8_STRW_IP_T3(1, 0), + [ARMV8_OPC_ICIALLU] = ARMV4_5_MCR(15, 0, 0, 7, 5, 0), }; void armv8_select_opcodes(struct armv8_common *armv8, bool state_is_aarch64) diff --git a/src/target/armv8_opcodes.h b/src/target/armv8_opcodes.h index 9200dac72..9f18e94d2 100644 --- a/src/target/armv8_opcodes.h +++ b/src/target/armv8_opcodes.h @@ -72,6 +72,8 @@ #define SYSTEM_DCCISW 0x43F2 #define SYSTEM_DCCSW 0x43D2 #define SYSTEM_ICIVAU 0x5BA9 +/* Attention, SYSTEM_ICIALLU requires rt=0x1f */ +#define SYSTEM_ICIALLU 0x03A8 #define SYSTEM_DCCVAU 0x5BD9 #define SYSTEM_DCCIVAC 0x5BF1 @@ -207,6 +209,7 @@ enum armv8_opcode { ARMV8_OPC_LDRH_IP, ARMV8_OPC_LDRW_IP, ARMV8_OPC_LDRD_IP, + ARMV8_OPC_ICIALLU, ARMV8_OPC_NUM, }; ----------------------------------------------------------------------- Summary of changes: src/target/armv8.h | 1 + src/target/armv8_cache.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++ src/target/armv8_opcodes.c | 2 ++ src/target/armv8_opcodes.h | 3 +++ 4 files changed, 68 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:25:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 98e34fd1f17207ce30fd5c80ab9aefb28fbdc688 (commit) from 50c1a156aeb7a96f2f8bacc8bfcfc93f1bbabb04 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 98e34fd1f17207ce30fd5c80ab9aefb28fbdc688 Author: HAOUES Ahmed <ahm...@st...> Date: Wed Mar 12 14:37:46 2025 +0100 flash/stm32l4x: support STM32U5F/U5Gx devices STM32U5F/U5Gx devices are similar to STM32U59/U5Ax devices while at there update STM32U5xx revisions Change-Id: I4f1c302cc91739a89cf4869401e9f5015dbc72b9 Signed-off-by: HAOUES Ahmed <ahm...@st...> Reviewed-on: https://review.openocd.org/c/openocd/+/8616 Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tarek BOCHKATI <tar...@gm...> Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 3062fca72..fa57db8bb 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -370,11 +370,15 @@ static const struct stm32l4_rev stm32u53_u54xx_revs[] = { static const struct stm32l4_rev stm32u57_u58xx_revs[] = { { 0x1000, "A" }, { 0x1001, "Z" }, { 0x1003, "Y" }, { 0x2000, "B" }, - { 0x2001, "X" }, { 0x3000, "C" }, { 0x3001, "W" }, + { 0x2001, "X" }, { 0x3000, "C" }, { 0x3001, "W" }, { 0x3007, "U" }, }; static const struct stm32l4_rev stm32u59_u5axx_revs[] = { - { 0x3001, "X" }, + { 0x3001, "X" }, { 0x3002, "W" }, +}; + +static const struct stm32l4_rev stm32u5f_u5gxx_revs[] = { + { 0x1000, "A" }, { 0x1001, "Z" }, }; static const struct stm32l4_rev stm32wba5x_revs[] = { @@ -674,6 +678,18 @@ static const struct stm32l4_part_info stm32l4_parts[] = { .otp_base = 0x0BFA0000, .otp_size = 512, }, + { + .id = DEVID_STM32U5F_U5GXX, + .revs = stm32u5f_u5gxx_revs, + .num_revs = ARRAY_SIZE(stm32u5f_u5gxx_revs), + .device_str = "STM32U5F/U5Gxx", + .max_flash_size_kb = 4096, + .flags = F_HAS_DUAL_BANK | F_QUAD_WORD_PROG | F_HAS_TZ | F_HAS_L5_FLASH_REGS, + .flash_regs_base = 0x40022000, + .fsize_addr = 0x0BFA07A0, + .otp_base = 0x0BFA0000, + .otp_size = 512, + }, { .id = DEVID_STM32WBA5X, .revs = stm32wba5x_revs, @@ -2095,6 +2111,7 @@ static int stm32l4_probe(struct flash_bank *bank) case DEVID_STM32U53_U54XX: case DEVID_STM32U57_U58XX: case DEVID_STM32U59_U5AXX: + case DEVID_STM32U5F_U5GXX: /* according to RM0456 Rev 4, Chapter 7.3.1 and 7.9.13 * U53x/U54x have 512K max flash size: * 512K variants are always in DUAL BANK mode @@ -2102,7 +2119,7 @@ static int stm32l4_probe(struct flash_bank *bank) * U57x/U58x have 2M max flash size: * 2M variants are always in DUAL BANK mode * 1M variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set - * U59x/U5Ax have 4M max flash size: + * U59x/U5Ax/U5Fx/U5Gx have 4M max flash size: * 4M variants are always in DUAL BANK mode * 2M variants can be in DUAL BANK mode if FLASH_OPTR:DUALBANK is set * Note: flash banks are always contiguous diff --git a/src/flash/nor/stm32l4x.h b/src/flash/nor/stm32l4x.h index f152c9f30..3199d4f6d 100644 --- a/src/flash/nor/stm32l4x.h +++ b/src/flash/nor/stm32l4x.h @@ -103,6 +103,7 @@ #define DEVID_STM32L4R_L4SXX 0x470 #define DEVID_STM32L4P_L4QXX 0x471 #define DEVID_STM32L55_L56XX 0x472 +#define DEVID_STM32U5F_U5GXX 0x476 #define DEVID_STM32G49_G4AXX 0x479 #define DEVID_STM32U59_U5AXX 0x481 #define DEVID_STM32U57_U58XX 0x482 ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32l4x.c | 23 ++++++++++++++++++++--- src/flash/nor/stm32l4x.h | 1 + 2 files changed, 21 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:24:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 50c1a156aeb7a96f2f8bacc8bfcfc93f1bbabb04 (commit) from f55ec6d4492251a453eb441dfd427b5f4ca4e452 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 50c1a156aeb7a96f2f8bacc8bfcfc93f1bbabb04 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 16:50:14 2023 +0100 command: factorize jim_command_mode() During 'help' dump, to determine the mode (e.g. COMMAND_CONFIG) of a command, the current code executes the OpenOCD TCL command "command mode", while it could directly call the implementation of the TCL command above. Factorize jim_command_mode() and call the inner implementation instead of executing "command mode". Change-Id: Id8c33d0ed1373b5744dcc3ac354c3e0a88576f75 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8585 Reviewed-by: Evgeniy Naydanov <evg...@sy...> Tested-by: jenkins diff --git a/src/helper/command.c b/src/helper/command.c index 38fb4f83b..3d4379d06 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -41,6 +41,7 @@ static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *a static int help_add_command(struct command_context *cmd_ctx, const char *cmd_name, const char *help_text, const char *usage_text); static int help_del_command(struct command_context *cmd_ctx, const char *cmd_name); +static enum command_mode get_command_mode(Jim_Interp *interp, const char *cmd_name); /* set of functions to wrap jimtcl internal data */ static inline bool jimcmd_is_proc(Jim_Cmd *cmd) @@ -779,24 +780,7 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c, if (is_match && show_help) { char *msg; - /* TODO: factorize jim_command_mode() to avoid running jim command here */ - char *request = alloc_printf("command mode %s", c->cmd_name); - if (!request) { - LOG_ERROR("Out of memory"); - return ERROR_FAIL; - } - int retval = Jim_Eval(CMD_CTX->interp, request); - free(request); - enum command_mode mode = COMMAND_UNKNOWN; - if (retval != JIM_ERR) { - const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), NULL); - if (!strcmp(result, "any")) - mode = COMMAND_ANY; - else if (!strcmp(result, "config")) - mode = COMMAND_CONFIG; - else if (!strcmp(result, "exec")) - mode = COMMAND_EXEC; - } + enum command_mode mode = get_command_mode(CMD_CTX->interp, c->cmd_name); /* Normal commands are runtime-only; highlight exceptions */ if (mode != COMMAND_EXEC) { @@ -809,6 +793,7 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c, case COMMAND_ANY: stage_msg = " (command valid any time)"; break; + case COMMAND_UNKNOWN: default: stage_msg = " (?mode error?)"; break; @@ -817,11 +802,13 @@ static COMMAND_HELPER(command_help_show, struct help_entry *c, } else msg = alloc_printf("%s", c->help ? c->help : ""); - if (msg) { - command_help_show_wrap(msg, n + 3, n + 3); - free(msg); - } else - return -ENOMEM; + if (!msg) { + LOG_ERROR("Out of memory"); + return ERROR_FAIL; + } + + command_help_show_wrap(msg, n + 3, n + 3); + free(msg); } return ERROR_OK; @@ -936,35 +923,41 @@ static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *a return retval; } +static enum command_mode get_command_mode(Jim_Interp *interp, const char *cmd_name) +{ + if (!cmd_name) + return COMMAND_UNKNOWN; + + Jim_Obj *s = Jim_NewStringObj(interp, cmd_name, -1); + Jim_IncrRefCount(s); + Jim_Cmd *cmd = Jim_GetCommand(interp, s, JIM_NONE); + Jim_DecrRefCount(interp, s); + + if (!cmd || !(jimcmd_is_proc(cmd) || jimcmd_is_oocd_command(cmd))) + return COMMAND_UNKNOWN; + + /* tcl proc */ + if (jimcmd_is_proc(cmd)) + return COMMAND_ANY; + + struct command *c = jimcmd_privdata(cmd); + return c->mode; +} + static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { struct command_context *cmd_ctx = current_command_context(interp); - enum command_mode mode; + enum command_mode mode = cmd_ctx->mode; if (argc > 1) { char *full_name = alloc_concatenate_strings(argc - 1, argv + 1); if (!full_name) return JIM_ERR; - Jim_Obj *s = Jim_NewStringObj(interp, full_name, -1); - Jim_IncrRefCount(s); - Jim_Cmd *cmd = Jim_GetCommand(interp, s, JIM_NONE); - Jim_DecrRefCount(interp, s); - free(full_name); - if (!cmd || !(jimcmd_is_proc(cmd) || jimcmd_is_oocd_command(cmd))) { - Jim_SetResultString(interp, "unknown", -1); - return JIM_OK; - } - if (jimcmd_is_proc(cmd)) { - /* tcl proc */ - mode = COMMAND_ANY; - } else { - struct command *c = jimcmd_privdata(cmd); + mode = get_command_mode(interp, full_name); - mode = c->mode; - } - } else - mode = cmd_ctx->mode; + free(full_name); + } const char *mode_str; switch (mode) { @@ -977,6 +970,7 @@ static int jim_command_mode(Jim_Interp *interp, int argc, Jim_Obj *const *argv) case COMMAND_EXEC: mode_str = "exec"; break; + case COMMAND_UNKNOWN: default: mode_str = "unknown"; break; ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 78 ++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 42 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:23:50
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f55ec6d4492251a453eb441dfd427b5f4ca4e452 (commit) from 864e1341ada378db6a553b2f13ef7741ffcede51 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f55ec6d4492251a453eb441dfd427b5f4ca4e452 Author: Antonio Borneo <bor...@gm...> Date: Sat Dec 2 14:21:42 2023 +0100 target: rewrite command 'write_memory' as COMMAND_HANDLER While there: - drop the command name from the error messages; - check the returned value from Jim_GetWide() to detect incorrect numeric values. Change-Id: I399402ac11b6d459f1771e59e44210aef3e2a637 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8582 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evg...@sy...> diff --git a/src/target/target.c b/src/target/target.c index cfb9cf3f3..2f736f0e8 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4526,50 +4526,36 @@ COMMAND_HANDLER(handle_target_read_memory) return ERROR_OK; } -static int target_jim_write_memory(Jim_Interp *interp, int argc, - Jim_Obj * const *argv) +COMMAND_HANDLER(handle_target_write_memory) { /* - * argv[1] = memory address - * argv[2] = desired element width in bits - * argv[3] = list of data to write - * argv[4] = optional "phys" + * CMD_ARGV[0] = memory address + * CMD_ARGV[1] = desired element width in bits + * CMD_ARGV[2] = list of data to write + * CMD_ARGV[3] = optional "phys" */ - if (argc < 4 || argc > 5) { - Jim_WrongNumArgs(interp, 1, argv, "address width data ['phys']"); - return JIM_ERR; - } + if (CMD_ARGC < 3 || CMD_ARGC > 4) + return ERROR_COMMAND_SYNTAX_ERROR; /* Arg 1: Memory address. */ - int e; - jim_wide wide_addr; - e = Jim_GetWide(interp, argv[1], &wide_addr); - - if (e != JIM_OK) - return e; - - target_addr_t addr = (target_addr_t)wide_addr; + target_addr_t addr; + COMMAND_PARSE_NUMBER(u64, CMD_ARGV[0], addr); /* Arg 2: Bit width of one element. */ - long l; - e = Jim_GetLong(interp, argv[2], &l); - - if (e != JIM_OK) - return e; + unsigned int width_bits; + COMMAND_PARSE_NUMBER(uint, CMD_ARGV[1], width_bits); - const unsigned int width_bits = l; - size_t count = Jim_ListLength(interp, argv[3]); + /* Arg 3: Elements to write. */ + size_t count = Jim_ListLength(CMD_CTX->interp, CMD_JIMTCL_ARGV[2]); /* Arg 4: Optional 'phys'. */ bool is_phys = false; - if (argc > 4) { - const char *phys = Jim_GetString(argv[4], NULL); - - if (strcmp(phys, "phys")) { - Jim_SetResultFormatted(interp, "invalid argument '%s', must be 'phys'", phys); - return JIM_ERR; + if (CMD_ARGC == 4) { + if (strcmp(CMD_ARGV[3], "phys")) { + command_print(CMD, "invalid argument '%s', must be 'phys'", CMD_ARGV[3]); + return ERROR_COMMAND_ARGUMENT_INVALID; } is_phys = true; @@ -4582,14 +4568,13 @@ static int target_jim_write_memory(Jim_Interp *interp, int argc, case 64: break; default: - Jim_SetResultString(interp, "invalid width, must be 8, 16, 32 or 64", -1); - return JIM_ERR; + command_print(CMD, "invalid width, must be 8, 16, 32 or 64"); + return ERROR_COMMAND_ARGUMENT_INVALID; } if (count > 65536) { - Jim_SetResultString(interp, - "write_memory: too large memory write request, exceeds 64K elements", -1); - return JIM_ERR; + command_print(CMD, "too large memory write request, exceeds 64K elements"); + return ERROR_COMMAND_ARGUMENT_INVALID; } const unsigned int width = width_bits / 8; @@ -4597,21 +4582,18 @@ static int target_jim_write_memory(Jim_Interp *interp, int argc, * due to overflow. */ if ((addr + count * width - 1) < addr) { - Jim_SetResultFormatted(interp, - "write_memory: memory region wraps over address zero"); - return JIM_ERR; + command_print(CMD, "memory region wraps over address zero"); + return ERROR_COMMAND_ARGUMENT_INVALID; } - struct command_context *cmd_ctx = current_command_context(interp); - assert(cmd_ctx); - struct target *target = get_current_target(cmd_ctx); + struct target *target = get_current_target(CMD_CTX); const size_t buffersize = 4096; uint8_t *buffer = malloc(buffersize); if (!buffer) { LOG_ERROR("Failed to allocate memory"); - return JIM_ERR; + return ERROR_FAIL; } size_t j = 0; @@ -4621,9 +4603,13 @@ static int target_jim_write_memory(Jim_Interp *interp, int argc, const size_t chunk_len = MIN(count, max_chunk_len); for (size_t i = 0; i < chunk_len; i++, j++) { - Jim_Obj *tmp = Jim_ListGetIndex(interp, argv[3], j); + Jim_Obj *tmp = Jim_ListGetIndex(CMD_CTX->interp, CMD_JIMTCL_ARGV[2], j); jim_wide element_wide; - Jim_GetWide(interp, tmp, &element_wide); + int jimretval = Jim_GetWide(CMD_CTX->interp, tmp, &element_wide); + if (jimretval != JIM_OK) { + command_print(CMD, "invalid value \"%s\"", Jim_GetString(tmp, NULL)); + return ERROR_COMMAND_ARGUMENT_INVALID; + } const uint64_t v = element_wide; @@ -4653,11 +4639,11 @@ static int target_jim_write_memory(Jim_Interp *interp, int argc, retval = target_write_memory(target, addr, width, chunk_len, buffer); if (retval != ERROR_OK) { - LOG_ERROR("write_memory: write at " TARGET_ADDR_FMT " with width=%u and count=%zu failed", + LOG_DEBUG("write at " TARGET_ADDR_FMT " with width=%u and count=%zu failed", addr, width_bits, chunk_len); - Jim_SetResultString(interp, "write_memory: failed to write memory", -1); - e = JIM_ERR; - break; + command_print(CMD, "failed to write memory"); + free(buffer); + return retval; } addr += chunk_len * width; @@ -4665,7 +4651,7 @@ static int target_jim_write_memory(Jim_Interp *interp, int argc, free(buffer); - return e; + return ERROR_OK; } /* FIX? should we propagate errors here rather than printing them @@ -5612,7 +5598,7 @@ static const struct command_registration target_instance_command_handlers[] = { { .name = "write_memory", .mode = COMMAND_EXEC, - .jim_handler = target_jim_write_memory, + .handler = handle_target_write_memory, .help = "Write Tcl list of 8/16/32/64 bit numbers to target memory", .usage = "address width data ['phys']", }, @@ -6747,7 +6733,7 @@ static const struct command_registration target_exec_command_handlers[] = { { .name = "write_memory", .mode = COMMAND_EXEC, - .jim_handler = target_jim_write_memory, + .handler = handle_target_write_memory, .help = "Write Tcl list of 8/16/32/64 bit numbers to target memory", .usage = "address width data ['phys']", }, ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 90 ++++++++++++++++++++++------------------------------- 1 file changed, 38 insertions(+), 52 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:23:35
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 864e1341ada378db6a553b2f13ef7741ffcede51 (commit) from 6d139422cb22ab3fc78f903038a7288acde4e4d4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 864e1341ada378db6a553b2f13ef7741ffcede51 Author: Antonio Borneo <bor...@gm...> Date: Sat Nov 23 18:35:51 2024 +0100 target: read_memory: drop command name from error messages The error message should not report the command name as it should be already clear from the context. Change-Id: I219e31be808bf6ff1924ce60f3025fb48ed7b125 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8803 Tested-by: jenkins diff --git a/src/target/target.c b/src/target/target.c index ce468cc90..cfb9cf3f3 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -4448,7 +4448,7 @@ COMMAND_HANDLER(handle_target_read_memory) } if (count > 65536) { - command_print(CMD, "read_memory: too large read request, exceeds 64K elements"); + command_print(CMD, "too large read request, exceeds 64K elements"); return ERROR_COMMAND_ARGUMENT_INVALID; } @@ -4457,7 +4457,7 @@ COMMAND_HANDLER(handle_target_read_memory) * due to overflow. */ if ((addr + count * width - 1) < addr) { - command_print(CMD, "read_memory: memory region wraps over address zero"); + command_print(CMD, "memory region wraps over address zero"); return ERROR_COMMAND_ARGUMENT_INVALID; } @@ -4484,13 +4484,13 @@ COMMAND_HANDLER(handle_target_read_memory) retval = target_read_memory(target, addr, width, chunk_len, buffer); if (retval != ERROR_OK) { - LOG_DEBUG("read_memory: read at " TARGET_ADDR_FMT " with width=%u and count=%zu failed", + LOG_DEBUG("read at " TARGET_ADDR_FMT " with width=%u and count=%zu failed", addr, width_bits, chunk_len); /* * FIXME: we append the errmsg to the list of value already read. * Add a way to flush and replace old output, but LOG_DEBUG() it */ - command_print(CMD, "read_memory: failed to read memory"); + command_print(CMD, "failed to read memory"); free(buffer); return retval; } ----------------------------------------------------------------------- Summary of changes: src/target/target.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-29 18:23:11
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 6d139422cb22ab3fc78f903038a7288acde4e4d4 (commit) from 72ff2e2d9f869cd19951ce101e5ac61209ec434d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6d139422cb22ab3fc78f903038a7288acde4e4d4 Author: Antonio Borneo <bor...@gm...> Date: Sat Nov 23 18:15:40 2024 +0100 helper: command: return correct error on command 'echo' In case of incorrect syntax, return ERROR_COMMAND_SYNTAX_ERROR so the command framework will print the usage string. Change-Id: I348debc77f470551d54fa77b4da780a48ff539c0 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8802 Tested-by: jenkins diff --git a/src/helper/command.c b/src/helper/command.c index d90d34141..38fb4f83b 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -673,7 +673,7 @@ COMMAND_HANDLER(handle_echo) } if (CMD_ARGC != 1) - return ERROR_FAIL; + return ERROR_COMMAND_SYNTAX_ERROR; LOG_USER("%s", CMD_ARGV[0]); return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/helper/command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-15 10:35:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 72ff2e2d9f869cd19951ce101e5ac61209ec434d (commit) from bb4c7e323393c74be1cba3836a32f0aa4a9b0dc7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 72ff2e2d9f869cd19951ce101e5ac61209ec434d Author: Adrien Grassein <agr...@na...> Date: Thu Jan 18 15:12:12 2024 +0100 target/armv8: regularly send keep_alive packet. Flushing all d-cache may be a long operation. We need to send keep_alive regularly to keep the connection alive. If not done a warning is emitted. Change-Id: I52c3ee9a9f9b8a1dc0b8d5439e8b71212f56165a Signed-off-by: Adrien Grassein <agr...@na...> Signed-off-by: Adrien Charruel <ach...@na...> Reviewed-on: https://review.openocd.org/c/openocd/+/8659 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/target/armv8_cache.c b/src/target/armv8_cache.c index 66d4e0080..74d063b0e 100644 --- a/src/target/armv8_cache.c +++ b/src/target/armv8_cache.c @@ -61,6 +61,7 @@ static int armv8_cache_d_inner_flush_level(struct armv8_common *armv8, struct ar goto done; c_way -= 1; } while (c_way >= 0); + keep_alive(); c_index -= 1; } while (c_index >= 0); ----------------------------------------------------------------------- Summary of changes: src/target/armv8_cache.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-15 10:34:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via bb4c7e323393c74be1cba3836a32f0aa4a9b0dc7 (commit) from 427528069806b20c05c78f935529bd62308351a9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bb4c7e323393c74be1cba3836a32f0aa4a9b0dc7 Author: Adrien Grassein <agr...@na...> Date: Thu Jan 18 12:04:02 2024 +0100 tcl/ngultra: Use newly created armv8r target ngultra cores are cortex-r52, so use armv8r target now its created. Change-Id: If2d22593ab1e200ac15e7b883c70937acf1d2a59 Signed-off-by: Adrien Grassein <agr...@na...> Signed-off-by: Adrien Charruel <ach...@na...> Reviewed-on: https://review.openocd.org/c/openocd/+/8658 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/tcl/target/ngultra.cfg b/tcl/target/ngultra.cfg index 956fdbb5c..9f9814fd7 100644 --- a/tcl/target/ngultra.cfg +++ b/tcl/target/ngultra.cfg @@ -36,12 +36,11 @@ dap create $_CHIPNAME.coresight.dap -chain-position $_CHIPNAME.coresight.cpu for { set _core 0 } { $_core < $_cores } { incr _core } { cti create cti.$_core -dap $_CHIPNAME.coresight.dap -ap-num 0 \ -baseaddr [lindex $CTIBASE $_core] -# Cores are armv8-r but works with aarch64 (since armv8-r not directly supported by openocd yet). if { $_core == 0} { - target create core.$_core aarch64 -dap $_CHIPNAME.coresight.dap \ + target create core.$_core armv8r -dap $_CHIPNAME.coresight.dap \ -ap-num 0 -dbgbase [lindex $DBGBASE $_core] -cti cti.$_core } else { - target create core.$_core aarch64 -dap $_CHIPNAME.coresight.dap \ + target create core.$_core armv8r -dap $_CHIPNAME.coresight.dap \ -ap-num 0 -dbgbase [lindex $DBGBASE $_core] -cti cti.$_core -defer-examine } } ----------------------------------------------------------------------- Summary of changes: tcl/target/ngultra.cfg | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-15 10:21:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 427528069806b20c05c78f935529bd62308351a9 (commit) via 6beb6280af985e79094501af5cb66d1a33019544 (commit) from e4a51b3235167ea2fccf399d55dc3fe87364dbb8 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 427528069806b20c05c78f935529bd62308351a9 Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 1 00:01:00 2024 +0100 adapter: simplify command 'adapter list' The code of command 'adapter list' is called by command 'adapter driver' to list the available drivers in case of error. This dual possible entry points require a conditional check on the number of command line arguments, reducing the code readability. Split the command in a simpler code for the command 'adapter list' that only checks the command line, and move in a common helper the code that list the drivers. While there, fix the output and the comments to report 'adapter driver' instead of 'debug adapters'; we are not parsing the HW to know which adapter is present. Change-Id: I17538e86dc4a31a9589d404e49dcc65a29393390 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8672 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index db3d3b0fe..2fcbd609e 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -392,12 +392,8 @@ COMMAND_HANDLER(handle_adapter_name) return ERROR_OK; } -COMMAND_HANDLER(handle_adapter_list_command) +COMMAND_HANDLER(dump_adapter_driver_list) { - if (strcmp(CMD_NAME, "list") == 0 && CMD_ARGC > 0) - return ERROR_COMMAND_SYNTAX_ERROR; - - command_print(CMD, "The following debug adapters are available:"); for (unsigned int i = 0; adapter_drivers[i]; i++) { const char *name = adapter_drivers[i]->name; command_print(CMD, "%u: %s", i + 1, name); @@ -406,6 +402,14 @@ COMMAND_HANDLER(handle_adapter_list_command) return ERROR_OK; } +COMMAND_HANDLER(handle_adapter_list_command) +{ + if (CMD_ARGC) + return ERROR_COMMAND_SYNTAX_ERROR; + + return CALL_COMMAND_HANDLER(dump_adapter_driver_list); +} + COMMAND_HANDLER(handle_adapter_driver_command) { int retval; @@ -440,7 +444,8 @@ COMMAND_HANDLER(handle_adapter_driver_command) */ LOG_ERROR("The specified debug interface was not found (%s)", CMD_ARGV[0]); - CALL_COMMAND_HANDLER(handle_adapter_list_command); + command_print(CMD, "The following adapter drivers are available:"); + CALL_COMMAND_HANDLER(dump_adapter_driver_list); return ERROR_JTAG_INVALID_INTERFACE; } commit 6beb6280af985e79094501af5cb66d1a33019544 Author: Antonio Borneo <bor...@gm...> Date: Sun Dec 22 17:13:59 2024 +0100 adapter: drop command 'adapter transports' The commit 93f2afa45f4c ("initial "transport" framework") that added the transport framework in 2010 was overly optimistic on the possibility to dynamically add, at runtime, a new adapter and to specify with the command 'adapter transports' the list of the transports supported by the new adapter. Such feature has never become part of OpenOCD, and the command above has never become useful nor ever been used. Drop the command 'adapter transports' and its documentation. Drop the helper 'transport_list_parse', now unused. Change-Id: Ie3d71c74d068fba802839b116bb9bc9af77cc83d Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8671 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 140d0f8c7..9ff524b74 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2415,12 +2415,6 @@ target. List the debug adapter drivers that have been built into the running copy of OpenOCD. @end deffn -@deffn {Config Command} {adapter transports} transport_name+ -Specifies the transports supported by this debug adapter. -The adapter driver builds-in similar knowledge; use this only -when external configuration (such as jumpering) changes what -the hardware can support. -@end deffn @anchor{adapter gpio} @deffn {Config Command} {adapter gpio [ @ diff --git a/src/jtag/adapter.c b/src/jtag/adapter.c index 04942f753..db3d3b0fe 100644 --- a/src/jtag/adapter.c +++ b/src/jtag/adapter.c @@ -392,25 +392,6 @@ COMMAND_HANDLER(handle_adapter_name) return ERROR_OK; } -COMMAND_HANDLER(adapter_transports_command) -{ - char **transports; - int retval; - - retval = CALL_COMMAND_HANDLER(transport_list_parse, &transports); - if (retval != ERROR_OK) - return retval; - - retval = allow_transports(CMD_CTX, (const char **)transports); - - if (retval != ERROR_OK) { - for (unsigned int i = 0; transports[i]; i++) - free(transports[i]); - free(transports); - } - return retval; -} - COMMAND_HANDLER(handle_adapter_list_command) { if (strcmp(CMD_NAME, "list") == 0 && CMD_ARGC > 0) @@ -1137,13 +1118,6 @@ static const struct command_registration adapter_command_handlers[] = { .usage = "", .chain = adapter_srst_command_handlers, }, - { - .name = "transports", - .handler = adapter_transports_command, - .mode = COMMAND_CONFIG, - .help = "Declare transports the adapter supports.", - .usage = "transport ...", - }, { .name = "usb", .mode = COMMAND_ANY, diff --git a/src/transport/transport.c b/src/transport/transport.c index c7293e7fd..0af136036 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -166,54 +166,6 @@ struct transport *get_current_transport(void) * Infrastructure for Tcl interface to transports. */ -/** - * Makes and stores a copy of a set of transports passed as - * parameters to a command. - * - * @param vector where the resulting copy is stored, as an argv-style - * NULL-terminated vector. - */ -COMMAND_HELPER(transport_list_parse, char ***vector) -{ - char **argv; - unsigned int n = CMD_ARGC; - unsigned int j = 0; - - *vector = NULL; - - if (n < 1) - return ERROR_COMMAND_SYNTAX_ERROR; - - /* our return vector must be NULL terminated */ - argv = calloc(n + 1, sizeof(char *)); - if (!argv) - return ERROR_FAIL; - - for (unsigned int i = 0; i < n; i++) { - struct transport *t; - - for (t = transport_list; t; t = t->next) { - if (strcmp(t->name, CMD_ARGV[i]) != 0) - continue; - argv[j++] = strdup(CMD_ARGV[i]); - break; - } - if (!t) { - LOG_ERROR("no such transport '%s'", CMD_ARGV[i]); - goto fail; - } - } - - *vector = argv; - return ERROR_OK; - -fail: - for (unsigned int i = 0; i < n; i++) - free(argv[i]); - free(argv); - return ERROR_FAIL; -} - COMMAND_HANDLER(handle_transport_init) { LOG_DEBUG("%s", __func__); diff --git a/src/transport/transport.h b/src/transport/transport.h index 00d8b07e1..2e3dcc61a 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -77,8 +77,6 @@ struct transport *get_current_transport(void); int transport_register_commands(struct command_context *ctx); -COMMAND_HELPER(transport_list_parse, char ***vector); - int allow_transports(struct command_context *ctx, const char * const *vector); bool transport_is_jtag(void); ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 6 ------ src/jtag/adapter.c | 41 ++++++++++------------------------------ src/transport/transport.c | 48 ----------------------------------------------- src/transport/transport.h | 2 -- 4 files changed, 10 insertions(+), 87 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: openocd-gerrit <ope...@us...> - 2025-03-15 10:20:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via e4a51b3235167ea2fccf399d55dc3fe87364dbb8 (commit) from e12ceddd5ee4d946107e3764d05ce2810befb293 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e4a51b3235167ea2fccf399d55dc3fe87364dbb8 Author: Antonio Borneo <bor...@gm...> Date: Mon Dec 23 20:59:28 2024 +0100 doc: drop mention of not implemented SPI transport The commit 93f2afa45f4c ("initial "transport" framework") adds a dedicated chapter in the documentation about a possible SPI transport for flashing. This transport has never been part of OpenOCD and should not be listed in the documentation. Drop the chapter. Change-Id: I9b406754399abda4dc7c2f8cf09dd47730a7e1d9 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/8670 Reviewed-by: Tomas Vanek <va...@fb...> Tested-by: jenkins diff --git a/doc/openocd.texi b/doc/openocd.texi index 386528a9d..140d0f8c7 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -3816,13 +3816,6 @@ Not all adapters and adapter drivers support SWD multi-drop. Only the following adapter drivers are SWD multi-drop capable: cmsis_dap (use an adapter with CMSIS-DAP version 2.0), ftdi, all bitbang based. -@subsection SPI Transport -@cindex SPI -@cindex Serial Peripheral Interface -The Serial Peripheral Interface (SPI) is a general purpose transport -which uses four wire signaling. Some processors use it as part of a -solution for flash programming. - @anchor{swimtransport} @subsection SWIM Transport @cindex SWIM ----------------------------------------------------------------------- Summary of changes: doc/openocd.texi | 7 ------- 1 file changed, 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |