jtag_tap_t -> struct jtag_tap
[openocd.git] / src / svf / svf.c
index 276a374ebfef129b2417001c429456e5aa336d6e..4dea968fd471f25b29e4f54e81a1eddd4093ff51 100644 (file)
@@ -210,14 +210,13 @@ static int svf_read_command_from_file(int fd);
 static int svf_check_tdo(void);
 static int svf_add_check_para(uint8_t enabled, int buffer_offset, int bit_len);
 static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str);
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
 
 static int svf_fd = 0;
 static char *svf_command_buffer = NULL;
 static int svf_command_buffer_size = 0;
 static int svf_line_number = 1;
 
-static jtag_tap_t *tap = NULL;
+static struct jtag_tap *tap = NULL;
 
 #define SVF_MAX_BUFFER_SIZE_TO_COMMIT  (4 * 1024)
 static uint8_t *svf_tdi_buffer = NULL, *svf_tdo_buffer = NULL, *svf_mask_buffer = NULL;
@@ -225,14 +224,6 @@ static int svf_buffer_index = 0, svf_buffer_size = 0;
 static int svf_quiet = 0;
 
 
-int svf_register_commands(struct command_context_s *cmd_ctx)
-{
-       register_command(cmd_ctx, NULL, "svf", handle_svf_command,
-               COMMAND_EXEC, "run svf <file>");
-
-       return ERROR_OK;
-}
-
 static void svf_free_xxd_para(svf_xxr_para_t *para)
 {
        if (NULL != para)
@@ -310,10 +301,10 @@ int svf_add_statemove(tap_state_t state_to)
        return ERROR_FAIL;
 }
 
-static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_svf_command)
 {
 #define SVF_NUM_OF_OPTIONS                     1
-       int command_num = 0, i;
+       int command_num = 0;
        int ret = ERROR_OK;
        long long time_ago;
 
@@ -325,7 +316,7 @@ static int handle_svf_command(struct command_context_s *cmd_ctx, char *cmd, char
 
        // parse variant
        svf_quiet = 0;
-       for (i = 1; i < argc; i++)
+       for (unsigned i = 1; i < argc; i++)
        {
                if (!strcmp(args[i], "quiet"))
                {
@@ -685,9 +676,9 @@ static int svf_copy_hexstring_to_binary(char *str, uint8_t **bin, int orig_bit_l
                str_len--;
 
        // check valid
-       if (str_len > 0 || (ch & ~((1 << (4 - (bit_len % 4))) - 1)) != 0)
+       if (str_len > 0 || (ch & ~((2 << ((bit_len - 1) % 4)) - 1)) != 0)
        {
-               LOG_ERROR("value execede length");
+               LOG_ERROR("value execeeds length");
                return ERROR_FAIL;
        }
 
@@ -1468,3 +1459,12 @@ static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str)
 
        return ERROR_OK;
 }
+
+int svf_register_commands(struct command_context_s *cmd_ctx)
+{
+       register_command(cmd_ctx, NULL, "svf",
+                       &handle_svf_command, COMMAND_EXEC,
+                       "run svf <file>");
+
+       return ERROR_OK;
+}

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)