* 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" },
JCFG_IDCODE,
};
-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 }
};
-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;
}
- 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);
if (e != JIM_OK) {
- Jim_GetOpt_NvpUnknown(goi, nvp_jtag_tap_event, 1);
+ jim_getopt_nvp_unknown(goi, nvp_jtag_tap_event, 1);
return e;
}
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);
return JIM_OK;
}
-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);
- 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);
if (e != JIM_OK) {
- Jim_GetOpt_NvpUnknown(goi, nvp_config_opts, 0);
+ jim_getopt_nvp_unknown(goi, nvp_config_opts, 0);
return e;
}
return (w & v) != 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;
- 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;
#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;
- 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 JIM_OK;
}
-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;
- Jim_Nvp *n;
+ struct jim_nvp *n;
char *cp;
- 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 },
}
const char *tmp;
- Jim_GetOpt_String(goi, &tmp, NULL);
+ jim_getopt_string(goi, &tmp, NULL);
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->ir_capture_value = 0x01;
while (goi->argc) {
- e = Jim_GetOpt_Nvp(goi, opts, &n);
+ e = jim_getopt_nvp(goi, opts, &n);
if (e != JIM_OK) {
- Jim_GetOpt_NvpUnknown(goi, opts, 0);
+ jim_getopt_nvp_unknown(goi, opts, 0);
free(cp);
free(pTap);
return e;
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));
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;
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;
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);
}
{
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;
{
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,
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;
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;