rtos: rework rtos_create()

To simplify the caller of rtos_create(), convert the code from
jimtcl oriented to OpenOCD commands.

While there, fix inconsistencies in almost every rtos create()
method and reset rtos_auto_detect to better cooperate on run-time
rtos configuration.

Change-Id: I59c443aaed77a48174facdfc86db75d6b28c8480
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8830
Tested-by: jenkins
This commit is contained in:
Antonio Borneo
2023-12-03 22:54:51 +01:00
parent afbd01b0a4
commit b3b790e4e0
13 changed files with 56 additions and 63 deletions

View File

@@ -5176,17 +5176,10 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde
command_print(CMD, "missing argument to %s", CMD_ARGV[index - 1]);
return ERROR_COMMAND_ARGUMENT_INVALID;
}
struct jim_getopt_info goi;
jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - index, CMD_JIMTCL_ARGV + index);
retval = rtos_create(CMD, target, CMD_ARGV[index]);
if (retval != ERROR_OK)
return retval;
index++;
goi.is_configure = true;
int resval = rtos_create(&goi, target);
int reslen;
const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
if (reslen > 0)
command_print(CMD, "%s", result);
if (resval != JIM_OK)
return ERROR_FAIL;
} else {
if (index != CMD_ARGC)
return ERROR_COMMAND_SYNTAX_ERROR;