helper/command: always pass struct command as jim private data
[openocd.git] / src / target / nds32_cmd.c
index 1accf6f83cae275b8dfcd8feb3163b9610074159..89da845d3f8ba82c21b7156e2d9ffe86ba11ae86 100644 (file)
@@ -722,7 +722,8 @@ static int jim_nds32_bulk_write(Jim_Interp *interp, int argc, Jim_Obj * const *a
                return JIM_ERR;
        }
 
-       struct target *target = Jim_CmdPrivData(goi.interp);
+       struct command *c = jim_to_command(goi.interp);
+       struct target *target = c->jim_handler_data;
        int result;
 
        result = target_write_buffer(target, address, count * 4, (const uint8_t *)data);
@@ -751,7 +752,8 @@ static int jim_nds32_multi_write(Jim_Interp *interp, int argc, Jim_Obj * const *
        if (e != JIM_OK)
                return e;
 
-       struct target *target = Jim_CmdPrivData(goi.interp);
+       struct command *c = jim_to_command(goi.interp);
+       struct target *target = c->jim_handler_data;
        struct aice_port_s *aice = target_to_aice(target);
        int result;
        uint32_t address;
@@ -812,7 +814,8 @@ static int jim_nds32_bulk_read(Jim_Interp *interp, int argc, Jim_Obj * const *ar
        if (goi.argc != 0)
                return JIM_ERR;
 
-       struct target *target = Jim_CmdPrivData(goi.interp);
+       struct command *c = jim_to_command(goi.interp);
+       struct target *target = c->jim_handler_data;
        uint32_t *data = malloc(count * sizeof(uint32_t));
        int result;
        result = target_read_buffer(target, address, count * 4, (uint8_t *)data);
@@ -863,7 +866,8 @@ static int jim_nds32_read_edm_sr(Jim_Interp *interp, int argc, Jim_Obj * const *
        else
                return ERROR_FAIL;
 
-       struct target *target = Jim_CmdPrivData(goi.interp);
+       struct command *c = jim_to_command(goi.interp);
+       struct target *target = c->jim_handler_data;
        struct aice_port_s *aice = target_to_aice(target);
        char data_str[11];
 
@@ -911,7 +915,8 @@ static int jim_nds32_write_edm_sr(Jim_Interp *interp, int argc, Jim_Obj * const
        else
                return ERROR_FAIL;
 
-       struct target *target = Jim_CmdPrivData(goi.interp);
+       struct command *c = jim_to_command(goi.interp);
+       struct target *target = c->jim_handler_data;
        struct aice_port_s *aice = target_to_aice(target);
 
        aice_write_debug_reg(aice, edm_sr_number, value);
@@ -1007,7 +1012,7 @@ static const struct command_registration nds32_exec_command_handlers[] = {
                .handler = handle_nds32_global_stop_command,
                .mode = COMMAND_ANY,
                .usage = "['on'|'off']",
-               .help = "turn on/off global stop. After turning on, every load/store" \
+               .help = "turn on/off global stop. After turning on, every load/store "
                         "instructions will be stopped to check memory access.",
        },
        {
@@ -1015,7 +1020,7 @@ static const struct command_registration nds32_exec_command_handlers[] = {
                .handler = handle_nds32_soft_reset_halt_command,
                .mode = COMMAND_ANY,
                .usage = "['on'|'off']",
-               .help = "as issuing rest-halt, to use soft-reset-halt or not." \
+               .help = "as issuing rest-halt, to use soft-reset-halt or not."
                         "the feature is for backward-compatible.",
        },
        {
@@ -1036,7 +1041,7 @@ static const struct command_registration nds32_exec_command_handlers[] = {
                .name = "login_edm_operation",
                .handler = handle_nds32_login_edm_operation_command,
                .mode = COMMAND_CONFIG,
-               .usage = "login_edm_operation misc_reg_no value",
+               .usage = "misc_reg_no value",
                .help = "add EDM operations for secure MCU debugging.",
        },
        {
@@ -1123,4 +1128,3 @@ const struct command_registration nds32_command_handlers[] = {
        },
        COMMAND_REGISTRATION_DONE
 };
-

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)