Audit and eliminate redundant #include directives in src/{pld,svf,xsvf}.
[openocd.git] / src / xsvf / xsvf.c
index 24a14de72f03dfea3b51e06ccd80f930deb504e4..b62de349d5d68466c29e2ba1e879ffffd8bb3e68 100644 (file)
 #endif
 
 #include "xsvf.h"
-
 #include "jtag.h"
-#include "command.h"
-#include "log.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <assert.h>
 
-#include <sys/time.h>
-#include <time.h>
+#include <assert.h>
 
 
 /* XSVF commands, from appendix B of xapp503.pdf  */
@@ -501,16 +489,18 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                        field.tap = tap;
                                        field.num_bits = xsdrsize;
                                        field.out_value = dr_out_buf;
-                                       
-                                       field.in_value = NULL;
-
-                                       jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL);
+                                       field.in_value = calloc(CEIL(field.num_bits, 8), 1);
 
                                        if (tap == NULL)
                                                jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE);
                                        else
                                                jtag_add_dr_scan(1, &field, TAP_DRPAUSE);
 
+                                       jtag_check_value_mask(&field, dr_in_buf, dr_in_mask);
+
+                                       free(field.in_value);
+
+
                                        /* LOG_DEBUG("FLUSHING QUEUE"); */
                                        result = jtag_execute_queue();
                                        if (result == ERROR_OK)
@@ -713,11 +703,11 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                        field.tap = tap;
                                        field.num_bits = bitcount;
                                        field.out_value = ir_buf;
-                                       
+
                                        field.in_value = NULL;
+
+
                                        
-                                       
-                                       field.in_handler = NULL;
 
                                        if (tap == NULL)
                                                jtag_add_plain_ir_scan(1, &field, my_end_state);
@@ -944,18 +934,21 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                        field.tap = tap;
                                        field.num_bits = xsdrsize;
                                        field.out_value = dr_out_buf;
-                                       
-                                       field.in_value = NULL;
+                                       field.in_value = calloc(CEIL(field.num_bits, 8), 1);
 
                                        if (attempt > 0 && verbose)
                                                LOG_USER("LSDR retry %d", attempt);
 
-                                       jtag_set_check_value(&field, dr_in_buf, dr_in_mask, NULL);
                                        if (tap == NULL)
                                                jtag_add_plain_dr_scan(1, &field, TAP_DRPAUSE);
                                        else
                                                jtag_add_dr_scan(1, &field, TAP_DRPAUSE);
 
+                                       jtag_check_value_mask(&field, dr_in_buf, dr_in_mask);
+
+                                       free(field.in_value);
+
+
                                        /* LOG_DEBUG("FLUSHING QUEUE"); */
                                        result = jtag_execute_queue();
                                        if(result == 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)