With the API fixed to comply with OpenOCD coding style, fix all
the references in the code.
Patch generated automatically with the script below.
The list is in reverse order to replace a common prefix after the
replacement of the symbols with the same prefix.
%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---
(cat << EOF
Jim_SetResult_NvpUnknown jim_set_result_nvp_unknown
Jim_Nvp_value2name_simple jim_nvp_value2name_simple
Jim_Nvp_value2name_obj jim_nvp_value2name_obj
Jim_Nvp_value2name jim_nvp_value2name
Jim_Nvp_name2value_simple jim_nvp_name2value_simple
Jim_Nvp_name2value_obj_nocase jim_nvp_name2value_obj_nocase
Jim_Nvp_name2value_obj jim_nvp_name2value_obj
Jim_Nvp_name2value_nocase_simple jim_nvp_name2value_nocase_simple
Jim_Nvp_name2value_nocase jim_nvp_name2value_nocase
Jim_Nvp_name2value jim_nvp_name2value
Jim_Nvp struct jim_nvp
Jim_GetOpt_Wide jim_getopt_wide
Jim_GetOpt_String jim_getopt_string
Jim_GetOpt_Setup jim_getopt_setup
Jim_GetOpt_Obj jim_getopt_obj
Jim_GetOpt_NvpUnknown jim_getopt_nvp_unknown
Jim_GetOpt_Nvp jim_getopt_nvp
Jim_GetOpt_Enum jim_getopt_enum
Jim_GetOpt_Double jim_getopt_double
Jim_GetOpt_Debug jim_getopt_debug
Jim_GetOptInfo struct jim_getopt_info
Jim_GetNvp jim_get_nvp
Jim_Debug_ArgvString jim_debug_argv_string
EOF
) | while read a b; do
sed -i "s/$a/$b/g" $(find src -type f ! -name jim-nvp.\? )
done
%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---%<---
Change-Id: I10a12bd64bb8b17575fd9150482c989c92b298a2
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6184
Reviewed-by: Marc Schink <dev@zapb.de>
Tested-by: jenkins
21 files changed:
static int jim_adapter_name(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
static int jim_adapter_name(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
/* return the name of the interface */
/* TCL code might need to know the exact type... */
/* return the name of the interface */
/* TCL code might need to know the exact type... */
#include <string.h>
/* */
#include <string.h>
/* */
-static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
struct jtag_tap *pTap)
{
jim_wide w;
struct jtag_tap *pTap)
{
jim_wide w;
- int e = Jim_GetOpt_Wide(goi, &w);
+ int e = jim_getopt_wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
n->name);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
n->name);
#define NTAP_OPT_EXPECTED_ID 0
/* */
#define NTAP_OPT_EXPECTED_ID 0
/* */
-static int jim_aice_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_aice_newtap_cmd(struct jim_getopt_info *goi)
{
struct jtag_tap *pTap;
int x;
int e;
{
struct jtag_tap *pTap;
int x;
int e;
- const Jim_Nvp opts[] = {
+ const struct jim_nvp opts[] = {
{.name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID},
{.name = NULL, .value = -1},
};
{.name = "-expected-id", .value = NTAP_OPT_EXPECTED_ID},
{.name = NULL, .value = -1},
};
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
pTap->chip = strdup(tmp);
pTap->chip = strdup(tmp);
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
while (goi->argc) {
pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
while (goi->argc) {
- e = Jim_GetOpt_Nvp(goi, opts, &n);
+ e = jim_getopt_nvp(goi, opts, &n);
- Jim_GetOpt_NvpUnknown(goi, opts, 0);
+ jim_getopt_nvp_unknown(goi, opts, 0);
free(cp);
free(pTap);
return e;
free(cp);
free(pTap);
return e;
/* */
static int jim_aice_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
/* */
static int jim_aice_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
return jim_aice_newtap_cmd(&goi);
}
return jim_aice_newtap_cmd(&goi);
}
static int jim_aice_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
int e = ERROR_OK;
static int jim_aice_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
int e = ERROR_OK;
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv - 1, "(no params)");
return JIM_ERR;
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv - 1, "(no params)");
return JIM_ERR;
static int jim_aice_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_aice_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
return JIM_ERR;
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
return JIM_ERR;
COMMAND_HANDLER(ftdi_handle_tdo_sample_edge_command)
{
COMMAND_HANDLER(ftdi_handle_tdo_sample_edge_command)
{
- Jim_Nvp *n;
- static const Jim_Nvp nvp_ftdi_jtag_modes[] = {
+ struct jim_nvp *n;
+ static const struct jim_nvp nvp_ftdi_jtag_modes[] = {
{ .name = "rising", .value = JTAG_MODE },
{ .name = "falling", .value = JTAG_MODE_ALT },
{ .name = NULL, .value = -1 },
};
if (CMD_ARGC > 0) {
{ .name = "rising", .value = JTAG_MODE },
{ .name = "falling", .value = JTAG_MODE_ALT },
{ .name = NULL, .value = -1 },
};
if (CMD_ARGC > 0) {
- n = Jim_Nvp_name2value_simple(nvp_ftdi_jtag_modes, CMD_ARGV[0]);
+ n = jim_nvp_name2value_simple(nvp_ftdi_jtag_modes, CMD_ARGV[0]);
if (n->name == NULL)
return ERROR_COMMAND_SYNTAX_ERROR;
ftdi_jtag_mode = n->value;
}
if (n->name == NULL)
return ERROR_COMMAND_SYNTAX_ERROR;
ftdi_jtag_mode = n->value;
}
- n = Jim_Nvp_value2name_simple(nvp_ftdi_jtag_modes, ftdi_jtag_mode);
+ n = jim_nvp_value2name_simple(nvp_ftdi_jtag_modes, ftdi_jtag_mode);
command_print(CMD, "ftdi samples TDO on %s edge of TCK", n->name);
return ERROR_OK;
command_print(CMD, "ftdi samples TDO on %s edge of TCK", n->name);
return ERROR_OK;
#include <transport/transport.h>
#include <helper/time_support.h>
#include <transport/transport.h>
#include <helper/time_support.h>
-static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
struct jtag_tap *pTap)
{
jim_wide w;
struct jtag_tap *pTap)
{
jim_wide w;
- int e = Jim_GetOpt_Wide(goi, &w);
+ int e = jim_getopt_wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
n->name);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter",
n->name);
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
-static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_hl_newtap_cmd(struct jim_getopt_info *goi)
{
struct jtag_tap *pTap;
int x;
int e;
{
struct jtag_tap *pTap;
int x;
int e;
- const Jim_Nvp opts[] = {
+ const struct jim_nvp opts[] = {
{ .name = "-irlen", .value = NTAP_OPT_IRLEN },
{ .name = "-irmask", .value = NTAP_OPT_IRMASK },
{ .name = "-ircapture", .value = NTAP_OPT_IRCAPTURE },
{ .name = "-irlen", .value = NTAP_OPT_IRLEN },
{ .name = "-irmask", .value = NTAP_OPT_IRMASK },
{ .name = "-ircapture", .value = NTAP_OPT_IRCAPTURE },
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
pTap->chip = strdup(tmp);
pTap->chip = strdup(tmp);
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
while (goi->argc) {
pTap->chip, pTap->tapname, pTap->dotted_name, goi->argc);
while (goi->argc) {
- e = Jim_GetOpt_Nvp(goi, opts, &n);
+ e = jim_getopt_nvp(goi, opts, &n);
- Jim_GetOpt_NvpUnknown(goi, opts, 0);
+ jim_getopt_nvp_unknown(goi, opts, 0);
free(cp);
free(pTap);
return e;
free(cp);
free(pTap);
return e;
case NTAP_OPT_IRMASK:
case NTAP_OPT_IRCAPTURE:
/* dummy read to ignore the next argument */
case NTAP_OPT_IRMASK:
case NTAP_OPT_IRCAPTURE:
/* dummy read to ignore the next argument */
- Jim_GetOpt_Wide(goi, NULL);
+ jim_getopt_wide(goi, NULL);
break;
} /* switch (n->value) */
} /* while (goi->argc) */
break;
} /* switch (n->value) */
} /* while (goi->argc) */
int jim_hl_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
int jim_hl_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
return jim_hl_newtap_cmd(&goi);
}
return jim_hl_newtap_cmd(&goi);
}
* Holds support for accessing JTAG-specific mechanisms from TCl scripts.
*/
* Holds support for accessing JTAG-specific mechanisms from TCl scripts.
*/
-static const Jim_Nvp nvp_jtag_tap_event[] = {
+static const struct jim_nvp nvp_jtag_tap_event[] = {
{ .value = JTAG_TRST_ASSERTED, .name = "post-reset" },
{ .value = JTAG_TAP_EVENT_SETUP, .name = "setup" },
{ .value = JTAG_TAP_EVENT_ENABLE, .name = "tap-enable" },
{ .value = JTAG_TRST_ASSERTED, .name = "post-reset" },
{ .value = JTAG_TAP_EVENT_SETUP, .name = "setup" },
{ .value = JTAG_TAP_EVENT_ENABLE, .name = "tap-enable" },
-static Jim_Nvp nvp_config_opts[] = {
+static struct jim_nvp nvp_config_opts[] = {
{ .name = "-event", .value = JCFG_EVENT },
{ .name = "-idcode", .value = JCFG_IDCODE },
{ .name = NULL, .value = -1 }
};
{ .name = "-event", .value = JCFG_EVENT },
{ .name = "-idcode", .value = JCFG_IDCODE },
{ .name = NULL, .value = -1 }
};
-static int jtag_tap_configure_event(Jim_GetOptInfo *goi, struct jtag_tap *tap)
+static int jtag_tap_configure_event(struct jim_getopt_info *goi, struct jtag_tap *tap)
{
if (goi->argc == 0) {
Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event <event-name> ...");
return JIM_ERR;
}
{
if (goi->argc == 0) {
Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-event <event-name> ...");
return JIM_ERR;
}
- Jim_Nvp *n;
- int e = Jim_GetOpt_Nvp(goi, nvp_jtag_tap_event, &n);
+ struct jim_nvp *n;
+ int e = jim_getopt_nvp(goi, nvp_jtag_tap_event, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_jtag_tap_event, 1);
+ jim_getopt_nvp_unknown(goi, nvp_jtag_tap_event, 1);
jteap->event = n->value;
Jim_Obj *o;
jteap->event = n->value;
Jim_Obj *o;
- Jim_GetOpt_Obj(goi, &o);
+ jim_getopt_obj(goi, &o);
jteap->body = Jim_DuplicateObj(goi->interp, o);
Jim_IncrRefCount(jteap->body);
jteap->body = Jim_DuplicateObj(goi->interp, o);
Jim_IncrRefCount(jteap->body);
-static int jtag_tap_configure_cmd(Jim_GetOptInfo *goi, struct jtag_tap *tap)
+static int jtag_tap_configure_cmd(struct jim_getopt_info *goi, struct jtag_tap *tap)
{
/* parse config or cget options */
while (goi->argc > 0) {
Jim_SetEmptyResult(goi->interp);
{
/* parse config or cget options */
while (goi->argc > 0) {
Jim_SetEmptyResult(goi->interp);
- Jim_Nvp *n;
- int e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n);
+ struct jim_nvp *n;
+ int e = jim_getopt_nvp(goi, nvp_config_opts, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+ jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
-static int jim_newtap_expected_id(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_expected_id(struct jim_nvp *n, struct jim_getopt_info *goi,
struct jtag_tap *pTap)
{
jim_wide w;
struct jtag_tap *pTap)
{
jim_wide w;
- int e = Jim_GetOpt_Wide(goi, &w);
+ int e = jim_getopt_wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter", n->name);
return e;
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "option: %s bad parameter", n->name);
return e;
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
#define NTAP_OPT_EXPECTED_ID 5
#define NTAP_OPT_VERSION 6
-static int jim_newtap_ir_param(Jim_Nvp *n, Jim_GetOptInfo *goi,
+static int jim_newtap_ir_param(struct jim_nvp *n, struct jim_getopt_info *goi,
struct jtag_tap *pTap)
{
jim_wide w;
struct jtag_tap *pTap)
{
jim_wide w;
- int e = Jim_GetOpt_Wide(goi, &w);
+ int e = jim_getopt_wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp,
"option: %s bad parameter", n->name);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp,
"option: %s bad parameter", n->name);
-static int jim_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_newtap_cmd(struct jim_getopt_info *goi)
{
struct jtag_tap *pTap;
int x;
int e;
{
struct jtag_tap *pTap;
int x;
int e;
- const Jim_Nvp opts[] = {
+ const struct jim_nvp opts[] = {
{ .name = "-irlen", .value = NTAP_OPT_IRLEN },
{ .name = "-irmask", .value = NTAP_OPT_IRMASK },
{ .name = "-ircapture", .value = NTAP_OPT_IRCAPTURE },
{ .name = "-irlen", .value = NTAP_OPT_IRLEN },
{ .name = "-irmask", .value = NTAP_OPT_IRMASK },
{ .name = "-ircapture", .value = NTAP_OPT_IRCAPTURE },
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
pTap->chip = strdup(tmp);
pTap->chip = strdup(tmp);
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
pTap->tapname = strdup(tmp);
/* name + dot + name + null */
pTap->ir_capture_value = 0x01;
while (goi->argc) {
pTap->ir_capture_value = 0x01;
while (goi->argc) {
- e = Jim_GetOpt_Nvp(goi, opts, &n);
+ e = jim_getopt_nvp(goi, opts, &n);
- Jim_GetOpt_NvpUnknown(goi, opts, 0);
+ jim_getopt_nvp_unknown(goi, opts, 0);
free(cp);
free(pTap);
return e;
free(cp);
free(pTap);
return e;
if (jteap->event != e)
continue;
if (jteap->event != e)
continue;
- Jim_Nvp *nvp = Jim_Nvp_value2name_simple(nvp_jtag_tap_event, e);
+ struct jim_nvp *nvp = jim_nvp_value2name_simple(nvp_jtag_tap_event, e);
LOG_DEBUG("JTAG tap: %s event: %d (%s)\n\taction: %s",
tap->dotted_name, e, nvp->name,
Jim_GetString(jteap->body, NULL));
LOG_DEBUG("JTAG tap: %s event: %d (%s)\n\taction: %s",
tap->dotted_name, e, nvp->name,
Jim_GetString(jteap->body, NULL));
static int jim_jtag_arp_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_jtag_arp_init(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int e = ERROR_OK;
static int jim_jtag_arp_init_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int e = ERROR_OK;
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
int jim_jtag_newtap(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
int jim_jtag_newtap(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
return jim_newtap_cmd(&goi);
}
return jim_newtap_cmd(&goi);
}
{
struct command *c = jim_to_command(interp);
const char *cmd_name = c->name;
{
struct command *c = jim_to_command(interp);
const char *cmd_name = c->name;
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
if (goi.argc != 1) {
Jim_SetResultFormatted(goi.interp, "usage: %s <name>", cmd_name);
return JIM_ERR;
if (goi.argc != 1) {
Jim_SetResultFormatted(goi.interp, "usage: %s <name>", cmd_name);
return JIM_ERR;
{
struct command *c = jim_to_command(interp);
const char *cmd_name = c->name;
{
struct command *c = jim_to_command(interp);
const char *cmd_name = c->name;
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
goi.isconfigure = !strcmp(cmd_name, "configure");
if (goi.argc < 2 + goi.isconfigure) {
Jim_WrongNumArgs(goi.interp, 0, NULL,
goi.isconfigure = !strcmp(cmd_name, "configure");
if (goi.argc < 2 + goi.isconfigure) {
Jim_WrongNumArgs(goi.interp, 0, NULL,
struct jtag_tap *t;
Jim_Obj *o;
struct jtag_tap *t;
Jim_Obj *o;
- Jim_GetOpt_Obj(&goi, &o);
+ jim_getopt_obj(&goi, &o);
t = jtag_tap_by_jim_obj(goi.interp, o);
if (t == NULL)
return JIM_ERR;
t = jtag_tap_by_jim_obj(goi.interp, o);
if (t == NULL)
return JIM_ERR;
static int jim_jtag_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_jtag_names(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc-1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc-1, argv + 1);
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
return JIM_ERR;
if (goi.argc != 0) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "Too many parameters");
return JIM_ERR;
-int rtos_create(Jim_GetOptInfo *goi, struct target *target)
+int rtos_create(struct jim_getopt_info *goi, struct target *target)
- e = Jim_GetOpt_String(goi, &cp, NULL);
+ e = jim_getopt_string(goi, &cp, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
#define GDB_THREAD_PACKET_NOT_CONSUMED (-40)
#define GDB_THREAD_PACKET_NOT_CONSUMED (-40)
-int rtos_create(Jim_GetOptInfo *goi, struct target *target);
+int rtos_create(struct jim_getopt_info *goi, struct target *target);
void rtos_destroy(struct target *target);
int rtos_set_reg(struct connection *connection, int reg_num,
uint8_t *reg_value);
void rtos_destroy(struct target *target);
int rtos_set_reg(struct connection *connection, int reg_num,
uint8_t *reg_value);
-static const Jim_Nvp nvp_config_opts[] = {
+static const struct jim_nvp nvp_config_opts[] = {
{ .name = "-cti", .value = CFG_CTI },
{ .name = NULL, .value = -1 }
};
{ .name = "-cti", .value = CFG_CTI },
{ .name = NULL, .value = -1 }
};
-static int aarch64_jim_configure(struct target *target, Jim_GetOptInfo *goi)
+static int aarch64_jim_configure(struct target *target, struct jim_getopt_info *goi)
{
struct aarch64_private_config *pc;
{
struct aarch64_private_config *pc;
int e;
pc = (struct aarch64_private_config *)target->private_config;
int e;
pc = (struct aarch64_private_config *)target->private_config;
Jim_SetEmptyResult(goi->interp);
/* check first if topmost item is for us */
Jim_SetEmptyResult(goi->interp);
/* check first if topmost item is for us */
- e = Jim_Nvp_name2value_obj(goi->interp, nvp_config_opts,
+ e = jim_nvp_name2value_obj(goi->interp, nvp_config_opts,
goi->argv[0], &n);
if (e != JIM_OK)
return JIM_CONTINUE;
goi->argv[0], &n);
if (e != JIM_OK)
return JIM_CONTINUE;
- e = Jim_GetOpt_Obj(goi, NULL);
+ e = jim_getopt_obj(goi, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
if (goi->isconfigure) {
Jim_Obj *o_cti;
struct arm_cti *cti;
if (goi->isconfigure) {
Jim_Obj *o_cti;
struct arm_cti *cti;
- e = Jim_GetOpt_Obj(goi, &o_cti);
+ e = jim_getopt_obj(goi, &o_cti);
if (e != JIM_OK)
return e;
cti = cti_instance_by_jim_obj(goi->interp, o_cti);
if (e != JIM_OK)
return e;
cti = cti_instance_by_jim_obj(goi->interp, o_cti);
struct target *target = get_current_target(CMD_CTX);
struct aarch64_common *aarch64 = target_to_aarch64(target);
struct target *target = get_current_target(CMD_CTX);
struct aarch64_common *aarch64 = target_to_aarch64(target);
- static const Jim_Nvp nvp_maskisr_modes[] = {
+ static const struct jim_nvp nvp_maskisr_modes[] = {
{ .name = "off", .value = AARCH64_ISRMASK_OFF },
{ .name = "on", .value = AARCH64_ISRMASK_ON },
{ .name = NULL, .value = -1 },
};
{ .name = "off", .value = AARCH64_ISRMASK_OFF },
{ .name = "on", .value = AARCH64_ISRMASK_ON },
{ .name = NULL, .value = -1 },
};
+ const struct jim_nvp *n;
- n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+ n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
if (n->name == NULL) {
LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
if (n->name == NULL) {
LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
aarch64->isrmasking_mode = n->value;
}
aarch64->isrmasking_mode = n->value;
}
- n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, aarch64->isrmasking_mode);
+ n = jim_nvp_value2name_simple(nvp_maskisr_modes, aarch64->isrmasking_mode);
command_print(CMD, "aarch64 interrupt mask %s", n->name);
return ERROR_OK;
command_print(CMD, "aarch64 interrupt mask %s", n->name);
return ERROR_OK;
* ------------------------------------------------------------------------- */
* ------------------------------------------------------------------------- */
-static int arc_cmd_jim_get_uint32(Jim_GetOptInfo *goi, uint32_t *value)
+static int arc_cmd_jim_get_uint32(struct jim_getopt_info *goi, uint32_t *value)
- JIM_CHECK_RETVAL(Jim_GetOpt_Wide(goi, &value_wide));
+ JIM_CHECK_RETVAL(jim_getopt_wide(goi, &value_wide));
*value = (uint32_t)value_wide;
return JIM_OK;
}
*value = (uint32_t)value_wide;
return JIM_OK;
}
CFG_ADD_REG_TYPE_FLAGS_FLAG,
};
CFG_ADD_REG_TYPE_FLAGS_FLAG,
};
-static Jim_Nvp nvp_add_reg_type_flags_opts[] = {
+static struct jim_nvp nvp_add_reg_type_flags_opts[] = {
{ .name = "-name", .value = CFG_ADD_REG_TYPE_FLAGS_NAME },
{ .name = "-flag", .value = CFG_ADD_REG_TYPE_FLAGS_FLAG },
{ .name = NULL, .value = -1 }
{ .name = "-name", .value = CFG_ADD_REG_TYPE_FLAGS_NAME },
{ .name = "-flag", .value = CFG_ADD_REG_TYPE_FLAGS_FLAG },
{ .name = NULL, .value = -1 }
/* Helper function to read the name of register type or register from
* configure files */
/* Helper function to read the name of register type or register from
* configure files */
-static int jim_arc_read_reg_name_field(Jim_GetOptInfo *goi,
+static int jim_arc_read_reg_name_field(struct jim_getopt_info *goi,
const char **name, int *name_len)
{
int e = JIM_OK;
const char **name, int *name_len)
{
int e = JIM_OK;
Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-name <name> ...");
return JIM_ERR;
}
Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "-name <name> ...");
return JIM_ERR;
}
- e = Jim_GetOpt_String(goi, name, name_len);
+ e = jim_getopt_string(goi, name, name_len);
return e;
}
/* Helper function to read bitfields/flags of register type. */
return e;
}
/* Helper function to read bitfields/flags of register type. */
-static int jim_arc_read_reg_type_field(Jim_GetOptInfo *goi, const char **field_name, int *field_name_len,
+static int jim_arc_read_reg_type_field(struct jim_getopt_info *goi, const char **field_name, int *field_name_len,
struct arc_reg_bitfield *bitfields, int cur_field, int type)
{
jim_wide start_pos, end_pos;
struct arc_reg_bitfield *bitfields, int cur_field, int type)
{
jim_wide start_pos, end_pos;
- e = Jim_GetOpt_String(goi, field_name, field_name_len);
+ e = jim_getopt_string(goi, field_name, field_name_len);
if (e != JIM_OK)
return e;
/* read start position of bitfield/flag */
if (e != JIM_OK)
return e;
/* read start position of bitfield/flag */
- e = Jim_GetOpt_Wide(goi, &start_pos);
+ e = jim_getopt_wide(goi, &start_pos);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
* than bitfields[cur_field].end remains start */
if ((strcmp(Jim_String(goi->argv[0]), "-flag") && type == CFG_ADD_REG_TYPE_FLAG)
|| (type == CFG_ADD_REG_TYPE_STRUCT)) {
* than bitfields[cur_field].end remains start */
if ((strcmp(Jim_String(goi->argv[0]), "-flag") && type == CFG_ADD_REG_TYPE_FLAG)
|| (type == CFG_ADD_REG_TYPE_STRUCT)) {
- e = Jim_GetOpt_Wide(goi, &end_pos);
+ e = jim_getopt_wide(goi, &end_pos);
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "Error reading end position");
return e;
if (e != JIM_OK) {
Jim_SetResultFormatted(goi->interp, "Error reading end position");
return e;
static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
static int jim_arc_add_reg_type_flags(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
flags->size = 4; /* For now ARC has only 32-bit registers */
while (goi.argc > 0 && e == JIM_OK) {
flags->size = 4; /* For now ARC has only 32-bit registers */
while (goi.argc > 0 && e == JIM_OK) {
- Jim_Nvp *n;
- e = Jim_GetOpt_Nvp(&goi, nvp_add_reg_type_flags_opts, &n);
+ struct jim_nvp *n;
+ e = jim_getopt_nvp(&goi, nvp_add_reg_type_flags_opts, &n);
- Jim_GetOpt_NvpUnknown(&goi, nvp_add_reg_type_flags_opts, 0);
+ jim_getopt_nvp_unknown(&goi, nvp_add_reg_type_flags_opts, 0);
CFG_ADD_REG_TYPE_STRUCT_BITFIELD,
};
CFG_ADD_REG_TYPE_STRUCT_BITFIELD,
};
-static Jim_Nvp nvp_add_reg_type_struct_opts[] = {
+static struct jim_nvp nvp_add_reg_type_struct_opts[] = {
{ .name = "-name", .value = CFG_ADD_REG_TYPE_STRUCT_NAME },
{ .name = "-bitfield", .value = CFG_ADD_REG_TYPE_STRUCT_BITFIELD },
{ .name = NULL, .value = -1 }
{ .name = "-name", .value = CFG_ADD_REG_TYPE_STRUCT_NAME },
{ .name = "-bitfield", .value = CFG_ADD_REG_TYPE_STRUCT_BITFIELD },
{ .name = NULL, .value = -1 }
uint32_t regnum;
uint32_t value;
uint32_t regnum;
uint32_t value;
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
if (goi.argc != 2) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc != 2) {
Jim_SetResultFormatted(goi.interp,
uint32_t regnum;
uint32_t value;
uint32_t regnum;
uint32_t value;
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
if (goi.argc != 1) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc != 1) {
Jim_SetResultFormatted(goi.interp,
uint32_t regnum;
uint32_t value;
uint32_t regnum;
uint32_t value;
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
if (goi.argc != 1) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc != 1) {
Jim_SetResultFormatted(goi.interp,
uint32_t regnum;
uint32_t value;
uint32_t regnum;
uint32_t value;
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
if (goi.argc != 2) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc != 2) {
Jim_SetResultFormatted(goi.interp,
static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
static int jim_arc_add_reg_type_struct(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
struct_type->size = 4; /* For now ARC has only 32-bit registers */
while (goi.argc > 0 && e == JIM_OK) {
struct_type->size = 4; /* For now ARC has only 32-bit registers */
while (goi.argc > 0 && e == JIM_OK) {
- Jim_Nvp *n;
- e = Jim_GetOpt_Nvp(&goi, nvp_add_reg_type_struct_opts, &n);
+ struct jim_nvp *n;
+ e = jim_getopt_nvp(&goi, nvp_add_reg_type_struct_opts, &n);
- Jim_GetOpt_NvpUnknown(&goi, nvp_add_reg_type_struct_opts, 0);
+ jim_getopt_nvp_unknown(&goi, nvp_add_reg_type_struct_opts, 0);
-static Jim_Nvp opts_nvp_add_reg[] = {
+static struct jim_nvp opts_nvp_add_reg[] = {
{ .name = "-name", .value = CFG_ADD_REG_NAME },
{ .name = "-num", .value = CFG_ADD_REG_ARCH_NUM },
{ .name = "-core", .value = CFG_ADD_REG_IS_CORE },
{ .name = "-name", .value = CFG_ADD_REG_NAME },
{ .name = "-num", .value = CFG_ADD_REG_ARCH_NUM },
{ .name = "-core", .value = CFG_ADD_REG_IS_CORE },
static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
static int jim_arc_add_reg(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ struct jim_getopt_info goi;
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
struct arc_reg_desc *reg = calloc(1, sizeof(*reg));
if (!reg) {
struct arc_reg_desc *reg = calloc(1, sizeof(*reg));
if (!reg) {
/* Parse options. */
while (goi.argc > 0) {
/* Parse options. */
while (goi.argc > 0) {
- Jim_Nvp *n;
- e = Jim_GetOpt_Nvp(&goi, opts_nvp_add_reg, &n);
+ struct jim_nvp *n;
+ e = jim_getopt_nvp(&goi, opts_nvp_add_reg, &n);
- Jim_GetOpt_NvpUnknown(&goi, opts_nvp_add_reg, 0);
+ jim_getopt_nvp_unknown(&goi, opts_nvp_add_reg, 0);
free_reg_desc(reg);
return e;
}
free_reg_desc(reg);
return e;
}
- e = Jim_GetOpt_Wide(&goi, &archnum);
+ e = jim_getopt_wide(&goi, &archnum);
if (e != JIM_OK) {
free_reg_desc(reg);
return e;
if (e != JIM_OK) {
free_reg_desc(reg);
return e;
* Reads struct type register field */
static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
* Reads struct type register field */
static int jim_arc_get_reg_field(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
+ struct jim_getopt_info goi;
const char *reg_name, *field_name;
uint32_t value;
int retval;
const char *reg_name, *field_name;
uint32_t value;
int retval;
- JIM_CHECK_RETVAL(Jim_GetOpt_Setup(&goi, interp, argc-1, argv+1));
+ JIM_CHECK_RETVAL(jim_getopt_setup(&goi, interp, argc-1, argv+1));
LOG_DEBUG("Reading register field");
if (goi.argc != 2) {
LOG_DEBUG("Reading register field");
if (goi.argc != 2) {
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_COMMAND_SYNTAX_ERROR;
}
- JIM_CHECK_RETVAL(Jim_GetOpt_String(&goi, ®_name, NULL));
- JIM_CHECK_RETVAL(Jim_GetOpt_String(&goi, &field_name, NULL));
+ JIM_CHECK_RETVAL(jim_getopt_string(&goi, ®_name, NULL));
+ JIM_CHECK_RETVAL(jim_getopt_string(&goi, &field_name, NULL));
assert(reg_name);
assert(field_name);
assert(reg_name);
assert(field_name);
static int jim_handle_actionpoints_num(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
static int jim_handle_actionpoints_num(Jim_Interp *interp, int argc,
Jim_Obj * const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
CFG_CTIBASE, /* DEPRECATED */
};
CFG_CTIBASE, /* DEPRECATED */
};
-static const Jim_Nvp nvp_config_opts[] = {
+static const struct jim_nvp nvp_config_opts[] = {
{ .name = "-dap", .value = CFG_DAP },
{ .name = "-ap-num", .value = CFG_AP_NUM },
{ .name = "-baseaddr", .value = CFG_BASEADDR },
{ .name = "-dap", .value = CFG_DAP },
{ .name = "-ap-num", .value = CFG_AP_NUM },
{ .name = "-baseaddr", .value = CFG_BASEADDR },
{ .name = NULL, .value = -1 }
};
{ .name = NULL, .value = -1 }
};
-static int adiv5_jim_spot_configure(Jim_GetOptInfo *goi,
+static int adiv5_jim_spot_configure(struct jim_getopt_info *goi,
struct adiv5_dap **dap_p, int *ap_num_p, uint32_t *base_p)
{
if (!goi->argc)
struct adiv5_dap **dap_p, int *ap_num_p, uint32_t *base_p)
{
if (!goi->argc)
Jim_SetEmptyResult(goi->interp);
Jim_SetEmptyResult(goi->interp);
- Jim_Nvp *n;
- int e = Jim_Nvp_name2value_obj(goi->interp, nvp_config_opts,
+ struct jim_nvp *n;
+ int e = jim_nvp_name2value_obj(goi->interp, nvp_config_opts,
goi->argv[0], &n);
if (e != JIM_OK)
return JIM_CONTINUE;
goi->argv[0], &n);
if (e != JIM_OK)
return JIM_CONTINUE;
if (!base_p && (n->value == CFG_BASEADDR || n->value == CFG_CTIBASE))
return JIM_CONTINUE;
if (!base_p && (n->value == CFG_BASEADDR || n->value == CFG_CTIBASE))
return JIM_CONTINUE;
- e = Jim_GetOpt_Obj(goi, NULL);
+ e = jim_getopt_obj(goi, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
if (goi->isconfigure) {
Jim_Obj *o_t;
struct adiv5_dap *dap;
if (goi->isconfigure) {
Jim_Obj *o_t;
struct adiv5_dap *dap;
- e = Jim_GetOpt_Obj(goi, &o_t);
+ e = jim_getopt_obj(goi, &o_t);
if (e != JIM_OK)
return e;
dap = dap_instance_by_jim_obj(goi->interp, o_t);
if (e != JIM_OK)
return e;
dap = dap_instance_by_jim_obj(goi->interp, o_t);
case CFG_AP_NUM:
if (goi->isconfigure) {
jim_wide ap_num;
case CFG_AP_NUM:
if (goi->isconfigure) {
jim_wide ap_num;
- e = Jim_GetOpt_Wide(goi, &ap_num);
+ e = jim_getopt_wide(goi, &ap_num);
if (e != JIM_OK)
return e;
if (ap_num < 0 || ap_num > DP_APSEL_MAX) {
if (e != JIM_OK)
return e;
if (ap_num < 0 || ap_num > DP_APSEL_MAX) {
case CFG_BASEADDR:
if (goi->isconfigure) {
jim_wide base;
case CFG_BASEADDR:
if (goi->isconfigure) {
jim_wide base;
- e = Jim_GetOpt_Wide(goi, &base);
+ e = jim_getopt_wide(goi, &base);
if (e != JIM_OK)
return e;
*base_p = (uint32_t)base;
if (e != JIM_OK)
return e;
*base_p = (uint32_t)base;
-int adiv5_jim_configure(struct target *target, Jim_GetOptInfo *goi)
+int adiv5_jim_configure(struct target *target, struct jim_getopt_info *goi)
{
struct adiv5_private_config *pc;
int e;
{
struct adiv5_private_config *pc;
int e;
}
int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
}
int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
+ struct jim_getopt_info *goi)
{
return adiv5_jim_spot_configure(goi, &cfg->dap, &cfg->ap_num, &cfg->base);
}
{
return adiv5_jim_spot_configure(goi, &cfg->dap, &cfg->ap_num, &cfg->base);
}
};
extern int adiv5_verify_config(struct adiv5_private_config *pc);
};
extern int adiv5_verify_config(struct adiv5_private_config *pc);
-extern int adiv5_jim_configure(struct target *target, Jim_GetOptInfo *goi);
+extern int adiv5_jim_configure(struct target *target, struct jim_getopt_info *goi);
struct adiv5_mem_ap_spot {
struct adiv5_dap *dap;
struct adiv5_mem_ap_spot {
struct adiv5_dap *dap;
extern int adiv5_mem_ap_spot_init(struct adiv5_mem_ap_spot *p);
extern int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
extern int adiv5_mem_ap_spot_init(struct adiv5_mem_ap_spot *p);
extern int adiv5_jim_mem_ap_spot_configure(struct adiv5_mem_ap_spot *cfg,
+ struct jim_getopt_info *goi);
#endif /* OPENOCD_TARGET_ARM_ADI_V5_H */
#endif /* OPENOCD_TARGET_ARM_ADI_V5_H */
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int cti_configure(Jim_GetOptInfo *goi, struct arm_cti *cti)
+static int cti_configure(struct jim_getopt_info *goi, struct arm_cti *cti)
{
/* parse config or cget options ... */
while (goi->argc > 0) {
{
/* parse config or cget options ... */
while (goi->argc > 0) {
-static int cti_create(Jim_GetOptInfo *goi)
+static int cti_create(struct jim_getopt_info *goi)
{
struct command_context *cmd_ctx;
static struct arm_cti *cti;
{
struct command_context *cmd_ctx;
static struct arm_cti *cti;
return JIM_ERR;
}
/* COMMAND */
return JIM_ERR;
}
/* COMMAND */
- Jim_GetOpt_Obj(goi, &new_cmd);
+ jim_getopt_obj(goi, &new_cmd);
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
static int jim_cti_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_cti_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 2) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
"<name> [<cti_options> ...]");
if (goi.argc < 2) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
"<name> [<cti_options> ...]");
CFG_IGNORE_SYSPWRUPACK,
};
CFG_IGNORE_SYSPWRUPACK,
};
-static const Jim_Nvp nvp_config_opts[] = {
+static const struct jim_nvp nvp_config_opts[] = {
{ .name = "-chain-position", .value = CFG_CHAIN_POSITION },
{ .name = "-ignore-syspwrupack", .value = CFG_IGNORE_SYSPWRUPACK },
{ .name = NULL, .value = -1 }
};
{ .name = "-chain-position", .value = CFG_CHAIN_POSITION },
{ .name = "-ignore-syspwrupack", .value = CFG_IGNORE_SYSPWRUPACK },
{ .name = NULL, .value = -1 }
};
-static int dap_configure(Jim_GetOptInfo *goi, struct arm_dap_object *dap)
+static int dap_configure(struct jim_getopt_info *goi, struct arm_dap_object *dap)
{
struct jtag_tap *tap = NULL;
{
struct jtag_tap *tap = NULL;
int e;
/* parse config or cget options ... */
while (goi->argc > 0) {
Jim_SetEmptyResult(goi->interp);
int e;
/* parse config or cget options ... */
while (goi->argc > 0) {
Jim_SetEmptyResult(goi->interp);
- e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n);
+ e = jim_getopt_nvp(goi, nvp_config_opts, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+ jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
return e;
}
switch (n->value) {
case CFG_CHAIN_POSITION: {
Jim_Obj *o_t;
return e;
}
switch (n->value) {
case CFG_CHAIN_POSITION: {
Jim_Obj *o_t;
- e = Jim_GetOpt_Obj(goi, &o_t);
+ e = jim_getopt_obj(goi, &o_t);
if (e != JIM_OK)
return e;
tap = jtag_tap_by_jim_obj(goi->interp, o_t);
if (e != JIM_OK)
return e;
tap = jtag_tap_by_jim_obj(goi->interp, o_t);
-static int dap_create(Jim_GetOptInfo *goi)
+static int dap_create(struct jim_getopt_info *goi)
{
struct command_context *cmd_ctx;
static struct arm_dap_object *dap;
{
struct command_context *cmd_ctx;
static struct arm_dap_object *dap;
return JIM_ERR;
}
/* COMMAND */
return JIM_ERR;
}
/* COMMAND */
- Jim_GetOpt_Obj(goi, &new_cmd);
+ jim_getopt_obj(goi, &new_cmd);
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
static int jim_dap_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_dap_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 2) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
"<name> [<dap_options> ...]");
if (goi.argc < 2) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
"<name> [<dap_options> ...]");
TPIU_SWO_EVENT_POST_DISABLE,
};
TPIU_SWO_EVENT_POST_DISABLE,
};
-static const Jim_Nvp nvp_arm_tpiu_swo_event[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_event[] = {
{ .value = TPIU_SWO_EVENT_PRE_ENABLE, .name = "pre-enable" },
{ .value = TPIU_SWO_EVENT_POST_ENABLE, .name = "post-enable" },
{ .value = TPIU_SWO_EVENT_PRE_DISABLE, .name = "pre-disable" },
{ .value = TPIU_SWO_EVENT_PRE_ENABLE, .name = "pre-enable" },
{ .value = TPIU_SWO_EVENT_POST_ENABLE, .name = "post-enable" },
{ .value = TPIU_SWO_EVENT_PRE_DISABLE, .name = "pre-disable" },
LOG_DEBUG("TPIU/SWO: %s event: %s (%d) action : %s",
obj->name,
LOG_DEBUG("TPIU/SWO: %s event: %s (%d) action : %s",
obj->name,
- Jim_Nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
+ jim_nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
event,
Jim_GetString(ea->body, NULL));
event,
Jim_GetString(ea->body, NULL));
Jim_MakeErrorMessage(ea->interp);
LOG_USER("Error executing event %s on TPIU/SWO %s:\n%s",
Jim_MakeErrorMessage(ea->interp);
LOG_USER("Error executing event %s on TPIU/SWO %s:\n%s",
- Jim_Nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
+ jim_nvp_value2name_simple(nvp_arm_tpiu_swo_event, event)->name,
obj->name,
Jim_GetString(Jim_GetResult(ea->interp), NULL));
/* clean both error code and stacktrace before return */
obj->name,
Jim_GetString(Jim_GetResult(ea->interp), NULL));
/* clean both error code and stacktrace before return */
"----------------------------------------");
for (struct arm_tpiu_swo_event_action *ea = obj->event_action; ea; ea = ea->next) {
"----------------------------------------");
for (struct arm_tpiu_swo_event_action *ea = obj->event_action; ea; ea = ea->next) {
- Jim_Nvp *opt = Jim_Nvp_value2name_simple(nvp_arm_tpiu_swo_event, ea->event);
+ struct jim_nvp *opt = jim_nvp_value2name_simple(nvp_arm_tpiu_swo_event, ea->event);
command_print(CMD, "%-25s | %s",
opt->name, Jim_GetString(ea->body, NULL));
}
command_print(CMD, "%-25s | %s",
opt->name, Jim_GetString(ea->body, NULL));
}
-static const Jim_Nvp nvp_arm_tpiu_swo_config_opts[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_config_opts[] = {
{ .name = "-port-width", .value = CFG_PORT_WIDTH },
{ .name = "-protocol", .value = CFG_PROTOCOL },
{ .name = "-formatter", .value = CFG_FORMATTER },
{ .name = "-port-width", .value = CFG_PORT_WIDTH },
{ .name = "-protocol", .value = CFG_PROTOCOL },
{ .name = "-formatter", .value = CFG_FORMATTER },
{ .name = "-pin-freq", .value = CFG_BITRATE },
{ .name = "-output", .value = CFG_OUTFILE },
{ .name = "-event", .value = CFG_EVENT },
{ .name = "-pin-freq", .value = CFG_BITRATE },
{ .name = "-output", .value = CFG_OUTFILE },
{ .name = "-event", .value = CFG_EVENT },
- /* handled by mem_ap_spot, added for Jim_GetOpt_NvpUnknown() */
+ /* handled by mem_ap_spot, added for jim_getopt_nvp_unknown() */
{ .name = "-dap", .value = -1 },
{ .name = "-ap-num", .value = -1 },
{ .name = "-baseaddr", .value = -1 },
{ .name = NULL, .value = -1 },
};
{ .name = "-dap", .value = -1 },
{ .name = "-ap-num", .value = -1 },
{ .name = "-baseaddr", .value = -1 },
{ .name = NULL, .value = -1 },
};
-static const Jim_Nvp nvp_arm_tpiu_swo_protocol_opts[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_protocol_opts[] = {
{ .name = "sync", .value = TPIU_SPPR_PROTOCOL_SYNC },
{ .name = "uart", .value = TPIU_SPPR_PROTOCOL_UART },
{ .name = "manchester", .value = TPIU_SPPR_PROTOCOL_MANCHESTER },
{ .name = NULL, .value = -1 },
};
{ .name = "sync", .value = TPIU_SPPR_PROTOCOL_SYNC },
{ .name = "uart", .value = TPIU_SPPR_PROTOCOL_UART },
{ .name = "manchester", .value = TPIU_SPPR_PROTOCOL_MANCHESTER },
{ .name = NULL, .value = -1 },
};
-static const Jim_Nvp nvp_arm_tpiu_swo_bool_opts[] = {
+static const struct jim_nvp nvp_arm_tpiu_swo_bool_opts[] = {
{ .name = "on", .value = 1 },
{ .name = "yes", .value = 1 },
{ .name = "1", .value = 1 },
{ .name = "on", .value = 1 },
{ .name = "yes", .value = 1 },
{ .name = "1", .value = 1 },
{ .name = NULL, .value = -1 },
};
{ .name = NULL, .value = -1 },
};
-static int arm_tpiu_swo_configure(Jim_GetOptInfo *goi, struct arm_tpiu_swo_object *obj)
+static int arm_tpiu_swo_configure(struct jim_getopt_info *goi, struct arm_tpiu_swo_object *obj)
if (e == JIM_ERR)
return e;
if (e == JIM_ERR)
return e;
- Jim_Nvp *n;
- e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_config_opts, &n);
+ struct jim_nvp *n;
+ e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_config_opts, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_arm_tpiu_swo_config_opts, 0);
+ jim_getopt_nvp_unknown(goi, nvp_arm_tpiu_swo_config_opts, 0);
case CFG_PORT_WIDTH:
if (goi->isconfigure) {
jim_wide port_width;
case CFG_PORT_WIDTH:
if (goi->isconfigure) {
jim_wide port_width;
- e = Jim_GetOpt_Wide(goi, &port_width);
+ e = jim_getopt_wide(goi, &port_width);
if (e != JIM_OK)
return e;
if (port_width < 1 || port_width > 32) {
if (e != JIM_OK)
return e;
if (port_width < 1 || port_width > 32) {
break;
case CFG_PROTOCOL:
if (goi->isconfigure) {
break;
case CFG_PROTOCOL:
if (goi->isconfigure) {
- Jim_Nvp *p;
- e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_protocol_opts, &p);
+ struct jim_nvp *p;
+ e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_protocol_opts, &p);
if (e != JIM_OK)
return e;
obj->pin_protocol = p->value;
} else {
if (goi->argc)
goto err_no_params;
if (e != JIM_OK)
return e;
obj->pin_protocol = p->value;
} else {
if (goi->argc)
goto err_no_params;
- Jim_Nvp *p;
- e = Jim_Nvp_value2name(goi->interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
+ struct jim_nvp *p;
+ e = jim_nvp_value2name(goi->interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
if (e != JIM_OK) {
Jim_SetResultString(goi->interp, "protocol error", -1);
return JIM_ERR;
if (e != JIM_OK) {
Jim_SetResultString(goi->interp, "protocol error", -1);
return JIM_ERR;
break;
case CFG_FORMATTER:
if (goi->isconfigure) {
break;
case CFG_FORMATTER:
if (goi->isconfigure) {
- Jim_Nvp *p;
- e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_bool_opts, &p);
+ struct jim_nvp *p;
+ e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_bool_opts, &p);
if (e != JIM_OK)
return e;
obj->en_formatter = p->value;
} else {
if (goi->argc)
goto err_no_params;
if (e != JIM_OK)
return e;
obj->en_formatter = p->value;
} else {
if (goi->argc)
goto err_no_params;
- Jim_Nvp *p;
- e = Jim_Nvp_value2name(goi->interp, nvp_arm_tpiu_swo_bool_opts, obj->en_formatter, &p);
+ struct jim_nvp *p;
+ e = jim_nvp_value2name(goi->interp, nvp_arm_tpiu_swo_bool_opts, obj->en_formatter, &p);
if (e != JIM_OK) {
Jim_SetResultString(goi->interp, "formatter error", -1);
return JIM_ERR;
if (e != JIM_OK) {
Jim_SetResultString(goi->interp, "formatter error", -1);
return JIM_ERR;
case CFG_TRACECLKIN:
if (goi->isconfigure) {
jim_wide clk;
case CFG_TRACECLKIN:
if (goi->isconfigure) {
jim_wide clk;
- e = Jim_GetOpt_Wide(goi, &clk);
+ e = jim_getopt_wide(goi, &clk);
if (e != JIM_OK)
return e;
obj->traceclkin_freq = clk;
if (e != JIM_OK)
return e;
obj->traceclkin_freq = clk;
case CFG_BITRATE:
if (goi->isconfigure) {
jim_wide clk;
case CFG_BITRATE:
if (goi->isconfigure) {
jim_wide clk;
- e = Jim_GetOpt_Wide(goi, &clk);
+ e = jim_getopt_wide(goi, &clk);
if (e != JIM_OK)
return e;
obj->swo_pin_freq = clk;
if (e != JIM_OK)
return e;
obj->swo_pin_freq = clk;
case CFG_OUTFILE:
if (goi->isconfigure) {
const char *s;
case CFG_OUTFILE:
if (goi->isconfigure) {
const char *s;
- e = Jim_GetOpt_String(goi, &s, NULL);
+ e = jim_getopt_string(goi, &s, NULL);
if (e != JIM_OK)
return e;
if (s[0] == ':') {
if (e != JIM_OK)
return e;
if (s[0] == ':') {
Jim_Obj *o;
struct arm_tpiu_swo_event_action *ea = obj->event_action;
Jim_Obj *o;
struct arm_tpiu_swo_event_action *ea = obj->event_action;
- e = Jim_GetOpt_Nvp(goi, nvp_arm_tpiu_swo_event, &p);
+ e = jim_getopt_nvp(goi, nvp_arm_tpiu_swo_event, &p);
- Jim_GetOpt_NvpUnknown(goi, nvp_arm_tpiu_swo_event, 1);
+ jim_getopt_nvp_unknown(goi, nvp_arm_tpiu_swo_event, 1);
Jim_DecrRefCount(ea->interp, ea->body);
ea->event = p->value;
ea->interp = goi->interp;
Jim_DecrRefCount(ea->interp, ea->body);
ea->event = p->value;
ea->interp = goi->interp;
- Jim_GetOpt_Obj(goi, &o);
+ jim_getopt_obj(goi, &o);
ea->body = Jim_DuplicateObj(goi->interp, o);
Jim_IncrRefCount(ea->body);
} else {
ea->body = Jim_DuplicateObj(goi->interp, o);
Jim_IncrRefCount(ea->body);
} else {
static int jim_arm_tpiu_swo_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
struct command *c = jim_to_command(interp);
static int jim_arm_tpiu_swo_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
struct command *c = jim_to_command(interp);
+ struct jim_getopt_info goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
goi.isconfigure = !strcmp(c->name, "configure");
if (goi.argc < 1) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
goi.isconfigure = !strcmp(c->name, "configure");
if (goi.argc < 1) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
value = 0;
}
if (!value) {
value = 0;
}
if (!value) {
- Jim_Nvp *p;
- Jim_Nvp_value2name(interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
+ struct jim_nvp *p;
+ jim_nvp_value2name(interp, nvp_arm_tpiu_swo_protocol_opts, obj->pin_protocol, &p);
LOG_ERROR("%s does not support protocol %s", obj->name, p->name);
return JIM_ERR;
}
LOG_ERROR("%s does not support protocol %s", obj->name, p->name);
return JIM_ERR;
}
static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 1) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "?name? ..options...");
return JIM_ERR;
if (goi.argc < 1) {
Jim_WrongNumArgs(goi.interp, 1, goi.argv, "?name? ..options...");
return JIM_ERR;
obj->port_width = 1;
Jim_Obj *n;
obj->port_width = 1;
Jim_Obj *n;
- Jim_GetOpt_Obj(&goi, &n);
+ jim_getopt_obj(&goi, &n);
obj->name = strdup(Jim_GetString(n, NULL));
if (!obj->name) {
LOG_ERROR("Out of memory");
obj->name = strdup(Jim_GetString(n, NULL));
if (!obj->name) {
LOG_ERROR("Out of memory");
unsigned int argp = 0;
int retval;
unsigned int argp = 0;
int retval;
- static const Jim_Nvp nvp_ecatch_modes[] = {
+ static const struct jim_nvp nvp_ecatch_modes[] = {
{ .name = "off", .value = 0 },
{ .name = "nsec_el1", .value = (1 << 5) },
{ .name = "nsec_el2", .value = (2 << 5) },
{ .name = "off", .value = 0 },
{ .name = "nsec_el1", .value = (1 << 5) },
{ .name = "nsec_el2", .value = (2 << 5) },
{ .name = "sec_el13", .value = (5 << 1) },
{ .name = NULL, .value = -1 },
};
{ .name = "sec_el13", .value = (5 << 1) },
{ .name = NULL, .value = -1 },
};
+ const struct jim_nvp *n;
if (CMD_ARGC == 0) {
const char *sec = NULL, *nsec = NULL;
if (CMD_ARGC == 0) {
const char *sec = NULL, *nsec = NULL;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- n = Jim_Nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0x0f);
+ n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0x0f);
if (n->name != NULL)
sec = n->name;
if (n->name != NULL)
sec = n->name;
- n = Jim_Nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0xf0);
+ n = jim_nvp_value2name_simple(nvp_ecatch_modes, edeccr & 0xf0);
if (n->name != NULL)
nsec = n->name;
if (n->name != NULL)
nsec = n->name;
}
while (CMD_ARGC > argp) {
}
while (CMD_ARGC > argp) {
- n = Jim_Nvp_name2value_simple(nvp_ecatch_modes, CMD_ARGV[argp]);
+ n = jim_nvp_name2value_simple(nvp_ecatch_modes, CMD_ARGV[argp]);
if (n->name == NULL) {
LOG_ERROR("Unknown option: %s", CMD_ARGV[argp]);
return ERROR_FAIL;
if (n->name == NULL) {
LOG_ERROR("Unknown option: %s", CMD_ARGV[argp]);
return ERROR_FAIL;
struct target *target = get_current_target(CMD_CTX);
struct cortex_a_common *cortex_a = target_to_cortex_a(target);
struct target *target = get_current_target(CMD_CTX);
struct cortex_a_common *cortex_a = target_to_cortex_a(target);
- static const Jim_Nvp nvp_maskisr_modes[] = {
+ static const struct jim_nvp nvp_maskisr_modes[] = {
{ .name = "off", .value = CORTEX_A_ISRMASK_OFF },
{ .name = "on", .value = CORTEX_A_ISRMASK_ON },
{ .name = NULL, .value = -1 },
};
{ .name = "off", .value = CORTEX_A_ISRMASK_OFF },
{ .name = "on", .value = CORTEX_A_ISRMASK_ON },
{ .name = NULL, .value = -1 },
};
+ const struct jim_nvp *n;
- n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+ n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
if (n->name == NULL) {
LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
if (n->name == NULL) {
LOG_ERROR("Unknown parameter: %s - should be off or on", CMD_ARGV[0]);
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_a->isrmasking_mode = n->value;
}
cortex_a->isrmasking_mode = n->value;
}
- n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, cortex_a->isrmasking_mode);
+ n = jim_nvp_value2name_simple(nvp_maskisr_modes, cortex_a->isrmasking_mode);
command_print(CMD, "cortex_a interrupt mask %s", n->name);
return ERROR_OK;
command_print(CMD, "cortex_a interrupt mask %s", n->name);
return ERROR_OK;
struct target *target = get_current_target(CMD_CTX);
struct cortex_a_common *cortex_a = target_to_cortex_a(target);
struct target *target = get_current_target(CMD_CTX);
struct cortex_a_common *cortex_a = target_to_cortex_a(target);
- static const Jim_Nvp nvp_dacrfixup_modes[] = {
+ static const struct jim_nvp nvp_dacrfixup_modes[] = {
{ .name = "off", .value = CORTEX_A_DACRFIXUP_OFF },
{ .name = "on", .value = CORTEX_A_DACRFIXUP_ON },
{ .name = NULL, .value = -1 },
};
{ .name = "off", .value = CORTEX_A_DACRFIXUP_OFF },
{ .name = "on", .value = CORTEX_A_DACRFIXUP_ON },
{ .name = NULL, .value = -1 },
};
+ const struct jim_nvp *n;
- n = Jim_Nvp_name2value_simple(nvp_dacrfixup_modes, CMD_ARGV[0]);
+ n = jim_nvp_name2value_simple(nvp_dacrfixup_modes, CMD_ARGV[0]);
if (n->name == NULL)
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_a->dacrfixup_mode = n->value;
}
if (n->name == NULL)
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_a->dacrfixup_mode = n->value;
}
- n = Jim_Nvp_value2name_simple(nvp_dacrfixup_modes, cortex_a->dacrfixup_mode);
+ n = jim_nvp_value2name_simple(nvp_dacrfixup_modes, cortex_a->dacrfixup_mode);
command_print(CMD, "cortex_a domain access control fixup %s", n->name);
return ERROR_OK;
command_print(CMD, "cortex_a domain access control fixup %s", n->name);
return ERROR_OK;
struct cortex_m_common *cortex_m = target_to_cm(target);
int retval;
struct cortex_m_common *cortex_m = target_to_cm(target);
int retval;
- static const Jim_Nvp nvp_maskisr_modes[] = {
+ static const struct jim_nvp nvp_maskisr_modes[] = {
{ .name = "auto", .value = CORTEX_M_ISRMASK_AUTO },
{ .name = "off", .value = CORTEX_M_ISRMASK_OFF },
{ .name = "on", .value = CORTEX_M_ISRMASK_ON },
{ .name = "steponly", .value = CORTEX_M_ISRMASK_STEPONLY },
{ .name = NULL, .value = -1 },
};
{ .name = "auto", .value = CORTEX_M_ISRMASK_AUTO },
{ .name = "off", .value = CORTEX_M_ISRMASK_OFF },
{ .name = "on", .value = CORTEX_M_ISRMASK_ON },
{ .name = "steponly", .value = CORTEX_M_ISRMASK_STEPONLY },
{ .name = NULL, .value = -1 },
};
+ const struct jim_nvp *n;
retval = cortex_m_verify_pointer(CMD, cortex_m);
retval = cortex_m_verify_pointer(CMD, cortex_m);
- n = Jim_Nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
+ n = jim_nvp_name2value_simple(nvp_maskisr_modes, CMD_ARGV[0]);
if (n->name == NULL)
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_m->isrmasking_mode = n->value;
cortex_m_set_maskints_for_halt(target);
}
if (n->name == NULL)
return ERROR_COMMAND_SYNTAX_ERROR;
cortex_m->isrmasking_mode = n->value;
cortex_m_set_maskints_for_halt(target);
}
- n = Jim_Nvp_value2name_simple(nvp_maskisr_modes, cortex_m->isrmasking_mode);
+ n = jim_nvp_value2name_simple(nvp_maskisr_modes, cortex_m->isrmasking_mode);
command_print(CMD, "cortex_m interrupt mask %s", n->name);
return ERROR_OK;
command_print(CMD, "cortex_m interrupt mask %s", n->name);
return ERROR_OK;
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 3) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc < 3) {
Jim_SetResultFormatted(goi.interp,
- e = Jim_GetOpt_Wide(&goi, &address);
+ e = jim_getopt_wide(&goi, &address);
if (e != JIM_OK)
return e;
jim_wide count;
if (e != JIM_OK)
return e;
jim_wide count;
- e = Jim_GetOpt_Wide(&goi, &count);
+ e = jim_getopt_wide(&goi, &count);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
jim_wide i;
for (i = 0; i < count; i++) {
jim_wide tmp;
jim_wide i;
for (i = 0; i < count; i++) {
jim_wide tmp;
- e = Jim_GetOpt_Wide(&goi, &tmp);
+ e = jim_getopt_wide(&goi, &tmp);
if (e != JIM_OK) {
free(data);
return e;
if (e != JIM_OK) {
free(data);
return e;
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 3) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc < 3) {
Jim_SetResultFormatted(goi.interp,
int e;
jim_wide num_of_pairs;
int e;
jim_wide num_of_pairs;
- e = Jim_GetOpt_Wide(&goi, &num_of_pairs);
+ e = jim_getopt_wide(&goi, &num_of_pairs);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
aice_set_command_mode(aice, AICE_COMMAND_MODE_PACK);
for (i = 0; i < num_of_pairs; i++) {
jim_wide tmp;
aice_set_command_mode(aice, AICE_COMMAND_MODE_PACK);
for (i = 0; i < num_of_pairs; i++) {
jim_wide tmp;
- e = Jim_GetOpt_Wide(&goi, &tmp);
+ e = jim_getopt_wide(&goi, &tmp);
if (e != JIM_OK)
break;
address = (uint32_t)tmp;
if (e != JIM_OK)
break;
address = (uint32_t)tmp;
- e = Jim_GetOpt_Wide(&goi, &tmp);
+ e = jim_getopt_wide(&goi, &tmp);
if (e != JIM_OK)
break;
data = (uint32_t)tmp;
if (e != JIM_OK)
break;
data = (uint32_t)tmp;
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 2) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc < 2) {
Jim_SetResultFormatted(goi.interp,
- e = Jim_GetOpt_Wide(&goi, &address);
+ e = jim_getopt_wide(&goi, &address);
if (e != JIM_OK)
return e;
jim_wide count;
if (e != JIM_OK)
return e;
jim_wide count;
- e = Jim_GetOpt_Wide(&goi, &count);
+ e = jim_getopt_wide(&goi, &count);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 1) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc < 1) {
Jim_SetResultFormatted(goi.interp,
int e;
const char *edm_sr_name;
int edm_sr_name_len;
int e;
const char *edm_sr_name;
int edm_sr_name_len;
- e = Jim_GetOpt_String(&goi, &edm_sr_name, &edm_sr_name_len);
+ e = jim_getopt_string(&goi, &edm_sr_name, &edm_sr_name_len);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
{
const char *cmd_name = Jim_GetString(argv[0], NULL);
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc < 2) {
Jim_SetResultFormatted(goi.interp,
if (goi.argc < 2) {
Jim_SetResultFormatted(goi.interp,
int e;
const char *edm_sr_name;
int edm_sr_name_len;
int e;
const char *edm_sr_name;
int edm_sr_name_len;
- e = Jim_GetOpt_String(&goi, &edm_sr_name, &edm_sr_name_len);
+ e = jim_getopt_string(&goi, &edm_sr_name, &edm_sr_name_len);
if (e != JIM_OK)
return e;
jim_wide value;
if (e != JIM_OK)
return e;
jim_wide value;
- e = Jim_GetOpt_Wide(&goi, &value);
+ e = jim_getopt_wide(&goi, &value);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
-static int stm8_jim_configure(struct target *target, Jim_GetOptInfo *goi)
+static int stm8_jim_configure(struct target *target, struct jim_getopt_info *goi)
{
struct stm8_common *stm8 = target_to_stm8(target);
jim_wide w;
{
struct stm8_common *stm8 = target_to_stm8(target);
jim_wide w;
arg = Jim_GetString(goi->argv[0], NULL);
if (!strcmp(arg, "-blocksize")) {
arg = Jim_GetString(goi->argv[0], NULL);
if (!strcmp(arg, "-blocksize")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-flashstart")) {
return JIM_OK;
}
if (!strcmp(arg, "-flashstart")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-flashend")) {
return JIM_OK;
}
if (!strcmp(arg, "-flashend")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-eepromstart")) {
return JIM_OK;
}
if (!strcmp(arg, "-eepromstart")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-eepromend")) {
return JIM_OK;
}
if (!strcmp(arg, "-eepromend")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-optionstart")) {
return JIM_OK;
}
if (!strcmp(arg, "-optionstart")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-optionend")) {
return JIM_OK;
}
if (!strcmp(arg, "-optionend")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-enable_step_irq")) {
return JIM_OK;
}
if (!strcmp(arg, "-enable_step_irq")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
return JIM_OK;
}
if (!strcmp(arg, "-enable_stm8l")) {
return JIM_OK;
}
if (!strcmp(arg, "-enable_stm8l")) {
- e = Jim_GetOpt_String(goi, &arg, NULL);
+ e = jim_getopt_string(goi, &arg, NULL);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
static LIST_HEAD(target_trace_callback_list);
static const int polling_interval = 100;
static LIST_HEAD(target_trace_callback_list);
static const int polling_interval = 100;
-static const Jim_Nvp nvp_assert[] = {
+static const struct jim_nvp nvp_assert[] = {
{ .name = "assert", NVP_ASSERT },
{ .name = "deassert", NVP_DEASSERT },
{ .name = "T", NVP_ASSERT },
{ .name = "assert", NVP_ASSERT },
{ .name = "deassert", NVP_DEASSERT },
{ .name = "T", NVP_ASSERT },
{ .name = NULL, .value = -1 }
};
{ .name = NULL, .value = -1 }
};
-static const Jim_Nvp nvp_error_target[] = {
+static const struct jim_nvp nvp_error_target[] = {
{ .value = ERROR_TARGET_INVALID, .name = "err-invalid" },
{ .value = ERROR_TARGET_INIT_FAILED, .name = "err-init-failed" },
{ .value = ERROR_TARGET_TIMEOUT, .name = "err-timeout" },
{ .value = ERROR_TARGET_INVALID, .name = "err-invalid" },
{ .value = ERROR_TARGET_INIT_FAILED, .name = "err-init-failed" },
{ .value = ERROR_TARGET_TIMEOUT, .name = "err-timeout" },
static const char *target_strerror_safe(int err)
{
static const char *target_strerror_safe(int err)
{
+ const struct jim_nvp *n;
- n = Jim_Nvp_value2name_simple(nvp_error_target, err);
+ n = jim_nvp_value2name_simple(nvp_error_target, err);
if (n->name == NULL)
return "unknown";
else
return n->name;
}
if (n->name == NULL)
return "unknown";
else
return n->name;
}
-static const Jim_Nvp nvp_target_event[] = {
+static const struct jim_nvp nvp_target_event[] = {
{ .value = TARGET_EVENT_GDB_HALT, .name = "gdb-halt" },
{ .value = TARGET_EVENT_HALTED, .name = "halted" },
{ .value = TARGET_EVENT_GDB_HALT, .name = "gdb-halt" },
{ .value = TARGET_EVENT_HALTED, .name = "halted" },
{ .name = NULL, .value = -1 }
};
{ .name = NULL, .value = -1 }
};
-static const Jim_Nvp nvp_target_state[] = {
+static const struct jim_nvp nvp_target_state[] = {
{ .name = "unknown", .value = TARGET_UNKNOWN },
{ .name = "running", .value = TARGET_RUNNING },
{ .name = "halted", .value = TARGET_HALTED },
{ .name = "unknown", .value = TARGET_UNKNOWN },
{ .name = "running", .value = TARGET_RUNNING },
{ .name = "halted", .value = TARGET_HALTED },
{ .name = NULL, .value = -1 },
};
{ .name = NULL, .value = -1 },
};
-static const Jim_Nvp nvp_target_debug_reason[] = {
+static const struct jim_nvp nvp_target_debug_reason[] = {
{ .name = "debug-request", .value = DBG_REASON_DBGRQ },
{ .name = "breakpoint", .value = DBG_REASON_BREAKPOINT },
{ .name = "watchpoint", .value = DBG_REASON_WATCHPOINT },
{ .name = "debug-request", .value = DBG_REASON_DBGRQ },
{ .name = "breakpoint", .value = DBG_REASON_BREAKPOINT },
{ .name = "watchpoint", .value = DBG_REASON_WATCHPOINT },
{ .name = NULL, .value = -1 },
};
{ .name = NULL, .value = -1 },
};
-static const Jim_Nvp nvp_target_endian[] = {
+static const struct jim_nvp nvp_target_endian[] = {
{ .name = "big", .value = TARGET_BIG_ENDIAN },
{ .name = "little", .value = TARGET_LITTLE_ENDIAN },
{ .name = "be", .value = TARGET_BIG_ENDIAN },
{ .name = "big", .value = TARGET_BIG_ENDIAN },
{ .name = "little", .value = TARGET_LITTLE_ENDIAN },
{ .name = "be", .value = TARGET_BIG_ENDIAN },
{ .name = NULL, .value = -1 },
};
{ .name = NULL, .value = -1 },
};
-static const Jim_Nvp nvp_reset_modes[] = {
+static const struct jim_nvp nvp_reset_modes[] = {
{ .name = "unknown", .value = RESET_UNKNOWN },
{ .name = "run", .value = RESET_RUN },
{ .name = "halt", .value = RESET_HALT },
{ .name = "unknown", .value = RESET_UNKNOWN },
{ .name = "run", .value = RESET_RUN },
{ .name = "halt", .value = RESET_HALT },
- cp = Jim_Nvp_value2name_simple(nvp_target_debug_reason,
+ cp = jim_nvp_value2name_simple(nvp_target_debug_reason,
t->debug_reason)->name;
if (!cp) {
LOG_ERROR("Invalid debug reason: %d", (int)(t->debug_reason));
t->debug_reason)->name;
if (!cp) {
LOG_ERROR("Invalid debug reason: %d", (int)(t->debug_reason));
const char *target_state_name(struct target *t)
{
const char *cp;
const char *target_state_name(struct target *t)
{
const char *cp;
- cp = Jim_Nvp_value2name_simple(nvp_target_state, t->state)->name;
+ cp = jim_nvp_value2name_simple(nvp_target_state, t->state)->name;
if (!cp) {
LOG_ERROR("Invalid target state: %d", (int)(t->state));
cp = "(*BUG*unknown*BUG*)";
if (!cp) {
LOG_ERROR("Invalid target state: %d", (int)(t->state));
cp = "(*BUG*unknown*BUG*)";
const char *target_event_name(enum target_event event)
{
const char *cp;
const char *target_event_name(enum target_event event)
{
const char *cp;
- cp = Jim_Nvp_value2name_simple(nvp_target_event, event)->name;
+ cp = jim_nvp_value2name_simple(nvp_target_event, event)->name;
if (!cp) {
LOG_ERROR("Invalid target event: %d", (int)(event));
cp = "(*BUG*unknown*BUG*)";
if (!cp) {
LOG_ERROR("Invalid target event: %d", (int)(event));
cp = "(*BUG*unknown*BUG*)";
const char *target_reset_mode_name(enum target_reset_mode reset_mode)
{
const char *cp;
const char *target_reset_mode_name(enum target_reset_mode reset_mode)
{
const char *cp;
- cp = Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode)->name;
+ cp = jim_nvp_value2name_simple(nvp_reset_modes, reset_mode)->name;
if (!cp) {
LOG_ERROR("Invalid target reset mode: %d", (int)(reset_mode));
cp = "(*BUG*unknown*BUG*)";
if (!cp) {
LOG_ERROR("Invalid target reset mode: %d", (int)(reset_mode));
cp = "(*BUG*unknown*BUG*)";
{
char buf[100];
int retval;
{
char buf[100];
int retval;
- Jim_Nvp *n;
- n = Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode);
+ struct jim_nvp *n;
+ n = jim_nvp_value2name_simple(nvp_reset_modes, reset_mode);
if (n->name == NULL) {
LOG_ERROR("invalid reset mode");
return ERROR_FAIL;
if (n->name == NULL) {
LOG_ERROR("invalid reset mode");
return ERROR_FAIL;
}
LOG_DEBUG("target event %i (%s) for core %s", event,
}
LOG_DEBUG("target event %i (%s) for core %s", event,
- Jim_Nvp_value2name_simple(nvp_target_event, event)->name,
+ jim_nvp_value2name_simple(nvp_target_event, event)->name,
target_name(target));
target_handle_event(target, event);
target_name(target));
target_handle_event(target, event);
struct target_reset_callback *callback;
LOG_DEBUG("target reset %i (%s)", reset_mode,
struct target_reset_callback *callback;
LOG_DEBUG("target reset %i (%s)", reset_mode,
- Jim_Nvp_value2name_simple(nvp_reset_modes, reset_mode)->name);
+ jim_nvp_value2name_simple(nvp_reset_modes, reset_mode)->name);
list_for_each_entry(callback, &target_reset_callback_list, list)
callback->callback(target, reset_mode, callback->priv);
list_for_each_entry(callback, &target_reset_callback_list, list)
callback->callback(target, reset_mode, callback->priv);
marker,
target_name(target),
target_type_name(target),
marker,
target_name(target),
target_type_name(target),
- Jim_Nvp_value2name_simple(nvp_target_endian,
+ jim_nvp_value2name_simple(nvp_target_endian,
target->endianness)->name,
target->tap->dotted_name,
state);
target->endianness)->name,
target->tap->dotted_name,
state);
once = false;
then = timeval_ms();
LOG_DEBUG("waiting for target %s...",
once = false;
then = timeval_ms();
LOG_DEBUG("waiting for target %s...",
- Jim_Nvp_value2name_simple(nvp_target_state, state)->name);
+ jim_nvp_value2name_simple(nvp_target_state, state)->name);
if ((cur-then) > ms) {
LOG_ERROR("timed out while waiting for target %s",
if ((cur-then) > ms) {
LOG_ERROR("timed out while waiting for target %s",
- Jim_Nvp_value2name_simple(nvp_target_state, state)->name);
+ jim_nvp_value2name_simple(nvp_target_state, state)->name);
enum target_reset_mode reset_mode = RESET_RUN;
if (CMD_ARGC == 1) {
enum target_reset_mode reset_mode = RESET_RUN;
if (CMD_ARGC == 1) {
- const Jim_Nvp *n;
- n = Jim_Nvp_name2value_simple(nvp_reset_modes, CMD_ARGV[0]);
+ const struct jim_nvp *n;
+ n = jim_nvp_name2value_simple(nvp_reset_modes, CMD_ARGV[0]);
if ((n->name == NULL) || (n->value == RESET_UNKNOWN))
return ERROR_COMMAND_SYNTAX_ERROR;
reset_mode = n->value;
if ((n->name == NULL) || (n->value == RESET_UNKNOWN))
return ERROR_COMMAND_SYNTAX_ERROR;
reset_mode = n->value;
target_name(target),
target_type_name(target),
e,
target_name(target),
target_type_name(target),
e,
- Jim_Nvp_value2name_simple(nvp_target_event, e)->name,
+ jim_nvp_value2name_simple(nvp_target_event, e)->name,
Jim_GetString(teap->body, NULL));
/* Override current target by the target an event
Jim_GetString(teap->body, NULL));
/* Override current target by the target an event
if (retval != JIM_OK) {
Jim_MakeErrorMessage(teap->interp);
LOG_USER("Error executing event %s on target %s:\n%s",
if (retval != JIM_OK) {
Jim_MakeErrorMessage(teap->interp);
LOG_USER("Error executing event %s on target %s:\n%s",
- Jim_Nvp_value2name_simple(nvp_target_event, e)->name,
+ jim_nvp_value2name_simple(nvp_target_event, e)->name,
target_name(target),
Jim_GetString(Jim_GetResult(teap->interp), NULL));
/* clean both error code and stacktrace before return */
target_name(target),
Jim_GetString(Jim_GetResult(teap->interp), NULL));
/* clean both error code and stacktrace before return */
TCFG_GDB_MAX_CONNECTIONS,
};
TCFG_GDB_MAX_CONNECTIONS,
};
-static Jim_Nvp nvp_config_opts[] = {
+static struct jim_nvp nvp_config_opts[] = {
{ .name = "-type", .value = TCFG_TYPE },
{ .name = "-event", .value = TCFG_EVENT },
{ .name = "-work-area-virt", .value = TCFG_WORK_AREA_VIRT },
{ .name = "-type", .value = TCFG_TYPE },
{ .name = "-event", .value = TCFG_EVENT },
{ .name = "-work-area-virt", .value = TCFG_WORK_AREA_VIRT },
{ .name = NULL, .value = -1 }
};
{ .name = NULL, .value = -1 }
};
-static int target_configure(Jim_GetOptInfo *goi, struct target *target)
+static int target_configure(struct jim_getopt_info *goi, struct target *target)
Jim_Obj *o;
jim_wide w;
int e;
Jim_Obj *o;
jim_wide w;
int e;
/* parse config or cget options ... */
while (goi->argc > 0) {
Jim_SetEmptyResult(goi->interp);
/* parse config or cget options ... */
while (goi->argc > 0) {
Jim_SetEmptyResult(goi->interp);
- /* Jim_GetOpt_Debug(goi); */
+ /* jim_getopt_debug(goi); */
if (target->type->target_jim_configure) {
/* target defines a configure function */
if (target->type->target_jim_configure) {
/* target defines a configure function */
}
/* otherwise we 'continue' below */
}
}
/* otherwise we 'continue' below */
}
- e = Jim_GetOpt_Nvp(goi, nvp_config_opts, &n);
+ e = jim_getopt_nvp(goi, nvp_config_opts, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+ jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
return e;
}
switch (n->value) {
return e;
}
switch (n->value) {
- e = Jim_GetOpt_Nvp(goi, nvp_target_event, &n);
+ e = jim_getopt_nvp(goi, nvp_target_event, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_target_event, 1);
+ jim_getopt_nvp_unknown(goi, nvp_target_event, 1);
}
teap->event = n->value;
teap->interp = goi->interp;
}
teap->event = n->value;
teap->interp = goi->interp;
- Jim_GetOpt_Obj(goi, &o);
+ jim_getopt_obj(goi, &o);
if (teap->body)
Jim_DecrRefCount(teap->interp, teap->body);
teap->body = Jim_DuplicateObj(goi->interp, o);
if (teap->body)
Jim_DecrRefCount(teap->interp, teap->body);
teap->body = Jim_DuplicateObj(goi->interp, o);
case TCFG_WORK_AREA_VIRT:
if (goi->isconfigure) {
target_free_all_working_areas(target);
case TCFG_WORK_AREA_VIRT:
if (goi->isconfigure) {
target_free_all_working_areas(target);
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
target->working_area_virt = w;
if (e != JIM_OK)
return e;
target->working_area_virt = w;
case TCFG_WORK_AREA_PHYS:
if (goi->isconfigure) {
target_free_all_working_areas(target);
case TCFG_WORK_AREA_PHYS:
if (goi->isconfigure) {
target_free_all_working_areas(target);
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
target->working_area_phys = w;
if (e != JIM_OK)
return e;
target->working_area_phys = w;
case TCFG_WORK_AREA_SIZE:
if (goi->isconfigure) {
target_free_all_working_areas(target);
case TCFG_WORK_AREA_SIZE:
if (goi->isconfigure) {
target_free_all_working_areas(target);
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
target->working_area_size = w;
if (e != JIM_OK)
return e;
target->working_area_size = w;
case TCFG_WORK_AREA_BACKUP:
if (goi->isconfigure) {
target_free_all_working_areas(target);
case TCFG_WORK_AREA_BACKUP:
if (goi->isconfigure) {
target_free_all_working_areas(target);
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
/* make this exactly 1 or 0 */
if (e != JIM_OK)
return e;
/* make this exactly 1 or 0 */
case TCFG_ENDIAN:
if (goi->isconfigure) {
case TCFG_ENDIAN:
if (goi->isconfigure) {
- e = Jim_GetOpt_Nvp(goi, nvp_target_endian, &n);
+ e = jim_getopt_nvp(goi, nvp_target_endian, &n);
- Jim_GetOpt_NvpUnknown(goi, nvp_target_endian, 1);
+ jim_getopt_nvp_unknown(goi, nvp_target_endian, 1);
return e;
}
target->endianness = n->value;
return e;
}
target->endianness = n->value;
if (goi->argc != 0)
goto no_params;
}
if (goi->argc != 0)
goto no_params;
}
- n = Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness);
+ n = jim_nvp_value2name_simple(nvp_target_endian, target->endianness);
if (n->name == NULL) {
target->endianness = TARGET_LITTLE_ENDIAN;
if (n->name == NULL) {
target->endianness = TARGET_LITTLE_ENDIAN;
- n = Jim_Nvp_value2name_simple(nvp_target_endian, target->endianness);
+ n = jim_nvp_value2name_simple(nvp_target_endian, target->endianness);
}
Jim_SetResultString(goi->interp, n->name, -1);
/* loop for more */
}
Jim_SetResultString(goi->interp, n->name, -1);
/* loop for more */
case TCFG_COREID:
if (goi->isconfigure) {
case TCFG_COREID:
if (goi->isconfigure) {
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
target->coreid = (int32_t)w;
if (e != JIM_OK)
return e;
target->coreid = (int32_t)w;
}
target_free_all_working_areas(target);
}
target_free_all_working_areas(target);
- e = Jim_GetOpt_Obj(goi, &o_t);
+ e = jim_getopt_obj(goi, &o_t);
if (e != JIM_OK)
return e;
tap = jtag_tap_by_jim_obj(goi->interp, o_t);
if (e != JIM_OK)
return e;
tap = jtag_tap_by_jim_obj(goi->interp, o_t);
break;
case TCFG_DBGBASE:
if (goi->isconfigure) {
break;
case TCFG_DBGBASE:
if (goi->isconfigure) {
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
target->dbgbase = (uint32_t)w;
if (e != JIM_OK)
return e;
target->dbgbase = (uint32_t)w;
- e = Jim_GetOpt_String(goi, &s, NULL);
+ e = jim_getopt_string(goi, &s, NULL);
if (e != JIM_OK)
return e;
free(target->gdb_port_override);
if (e != JIM_OK)
return e;
free(target->gdb_port_override);
- e = Jim_GetOpt_Wide(goi, &w);
+ e = jim_getopt_wide(goi, &w);
if (e != JIM_OK)
return e;
target->gdb_max_connections = (w < 0) ? CONNECTION_LIMIT_UNLIMITED : (int)w;
if (e != JIM_OK)
return e;
target->gdb_max_connections = (w < 0) ? CONNECTION_LIMIT_UNLIMITED : (int)w;
static int jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
struct command *c = jim_to_command(interp);
static int jim_target_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
struct command *c = jim_to_command(interp);
+ struct jim_getopt_info goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
goi.isconfigure = !strcmp(c->name, "configure");
if (goi.argc < 1) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
goi.isconfigure = !strcmp(c->name, "configure");
if (goi.argc < 1) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
{
bool allow_defer = false;
{
bool allow_defer = false;
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ 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,
if (goi.argc > 1) {
const char *cmd_name = Jim_GetString(argv[0], NULL);
Jim_SetResultFormatted(goi.interp,
strcmp(Jim_GetString(argv[1], NULL), "allow-defer") == 0) {
/* consume it */
Jim_Obj *obj;
strcmp(Jim_GetString(argv[1], NULL), "allow-defer") == 0) {
/* consume it */
Jim_Obj *obj;
- int e = Jim_GetOpt_Obj(&goi, &obj);
+ int e = jim_getopt_obj(&goi, &obj);
if (e != JIM_OK)
return e;
allow_defer = true;
if (e != JIM_OK)
return e;
allow_defer = true;
static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
if (goi.argc != 2) {
Jim_WrongNumArgs(interp, 0, argv,
if (goi.argc != 2) {
Jim_WrongNumArgs(interp, 0, argv,
- Jim_Nvp *n;
- int e = Jim_GetOpt_Nvp(&goi, nvp_assert, &n);
+ struct jim_nvp *n;
+ int e = jim_getopt_nvp(&goi, nvp_assert, &n);
- Jim_GetOpt_NvpUnknown(&goi, nvp_assert, 1);
+ jim_getopt_nvp_unknown(&goi, nvp_assert, 1);
return e;
}
/* the halt or not param */
jim_wide a;
return e;
}
/* the halt or not param */
jim_wide a;
- e = Jim_GetOpt_Wide(&goi, &a);
+ e = jim_getopt_wide(&goi, &a);
if (e != JIM_OK)
return e;
if (e != JIM_OK)
return e;
static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_target_wait_state(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
/* params: <name> statename timeoutmsecs */
if (goi.argc != 2) {
/* params: <name> statename timeoutmsecs */
if (goi.argc != 2) {
- Jim_Nvp *n;
- int e = Jim_GetOpt_Nvp(&goi, nvp_target_state, &n);
+ struct jim_nvp *n;
+ int e = jim_getopt_nvp(&goi, nvp_target_state, &n);
- Jim_GetOpt_NvpUnknown(&goi, nvp_target_state, 1);
+ jim_getopt_nvp_unknown(&goi, nvp_target_state, 1);
- e = Jim_GetOpt_Wide(&goi, &a);
+ e = jim_getopt_wide(&goi, &a);
if (e != JIM_OK)
return e;
struct command_context *cmd_ctx = current_command_context(interp);
if (e != JIM_OK)
return e;
struct command_context *cmd_ctx = current_command_context(interp);
command_print(CMD, "------------------------- | "
"----------------------------------------");
while (teap) {
command_print(CMD, "------------------------- | "
"----------------------------------------");
while (teap) {
- Jim_Nvp *opt = Jim_Nvp_value2name_simple(nvp_target_event, teap->event);
+ struct jim_nvp *opt = jim_nvp_value2name_simple(nvp_target_event, teap->event);
command_print(CMD, "%-25s | %s",
opt->name, Jim_GetString(teap->body, NULL));
teap = teap->next;
command_print(CMD, "%-25s | %s",
opt->name, Jim_GetString(teap->body, NULL));
teap = teap->next;
}
static int jim_target_invoke_event(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
}
static int jim_target_invoke_event(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ 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;
}
if (goi.argc != 1) {
const char *cmd_name = Jim_GetString(argv[0], NULL);
Jim_SetResultFormatted(goi.interp, "%s <eventname>", cmd_name);
return JIM_ERR;
}
- Jim_Nvp *n;
- int e = Jim_GetOpt_Nvp(&goi, nvp_target_event, &n);
+ struct jim_nvp *n;
+ int e = jim_getopt_nvp(&goi, nvp_target_event, &n);
- Jim_GetOpt_NvpUnknown(&goi, nvp_target_event, 1);
+ jim_getopt_nvp_unknown(&goi, nvp_target_event, 1);
return e;
}
struct command_context *cmd_ctx = current_command_context(interp);
return e;
}
struct command_context *cmd_ctx = current_command_context(interp);
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-static int target_create(Jim_GetOptInfo *goi)
+static int target_create(struct jim_getopt_info *goi)
{
Jim_Obj *new_cmd;
Jim_Cmd *cmd;
{
Jim_Obj *new_cmd;
Jim_Cmd *cmd;
- Jim_GetOpt_Obj(goi, &new_cmd);
+ jim_getopt_obj(goi, &new_cmd);
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
/* does this command exist? */
cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_ERRMSG);
if (cmd) {
- e = Jim_GetOpt_String(goi, &cp, NULL);
+ e = jim_getopt_string(goi, &cp, NULL);
if (e != JIM_OK)
return e;
struct transport *tr = get_current_transport();
if (e != JIM_OK)
return e;
struct transport *tr = get_current_transport();
static int jim_target_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
static int jim_target_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
- Jim_GetOptInfo goi;
- Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
+ 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> ...]");
if (goi.argc < 3) {
Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
"<name> <target_type> [<target_options> ...]");
/* called for various config parameters */
/* returns JIM_CONTINUE - if option not understood */
/* otherwise: JIM_OK, or JIM_ERR, */
/* called for various config parameters */
/* returns JIM_CONTINUE - if option not understood */
/* otherwise: JIM_OK, or JIM_ERR, */
- int (*target_jim_configure)(struct target *target, Jim_GetOptInfo *goi);
+ int (*target_jim_configure)(struct target *target, struct jim_getopt_info *goi);
/* target commands specifically handled by the target */
/* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
/* target commands specifically handled by the target */
/* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
- int (*target_jim_commands)(struct target *target, Jim_GetOptInfo *goi);
+ int (*target_jim_commands)(struct target *target, struct jim_getopt_info *goi);
/**
* This method is used to perform target setup that requires
/**
* This method is used to perform target setup that requires