SVF/XSVF: comment and whitespace fixes
authorDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 20 Oct 2009 05:50:51 +0000 (22:50 -0700)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Tue, 20 Oct 2009 05:50:51 +0000 (22:50 -0700)
SVF: comment the predefined/default paths; make them static const

SVF, XSVF: whitespace fixes, mostly so copyrights display sanely

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/svf/svf.c
src/xsvf/xsvf.c

index a25b3580cc0d1f991d82376c2c1be44ec2094c86..5b96971c1fd7fd597332d5796335d66c13a9c3ec 100644 (file)
@@ -1,22 +1,21 @@
-/***************************************************************************
- *      Copyright (C) 2009 by Simon Qian                                                                          *
- *      SimonQian@SimonQian.com                                                                                           *
- *                                                                         *
- *      This program is free software; you can redistribute it and/or modify  *
- *      it under the terms of the GNU General Public License as published by  *
- *      the Free Software Foundation; either version 2 of the License, or         *
- *      (at your option) any later version.                                                               *
- *                                                                                                                                                *
- *      This program is distributed in the hope that it will be useful,           *
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of            *
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
- *      GNU General Public License for more details.                                              *
- *                                                                                                                                                *
- *      You should have received a copy of the GNU General Public License         *
- *      along with this program; if not, write to the                                             *
- *      Free Software Foundation, Inc.,                                                                           *
- *      59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                         *
- ***************************************************************************/
+/*
+ * Copyright (C) 2009 by Simon Qian
+ * SimonQian@SimonQian.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 
 /* The specification for SVF is available here:
 
 
 /* The specification for SVF is available here:
@@ -98,7 +97,22 @@ typedef struct
        tap_state_t paths[8];
 }svf_statemove_t;
 
        tap_state_t paths[8];
 }svf_statemove_t;
 
-svf_statemove_t svf_statemoves[] =
+/*
+ * These paths are from the SVF specification for the STATE command, to be
+ * used when the STATE command only includes the final state.  The first
+ * element of the path is the "from" (current) state, and the last one is
+ * the "to" (target) state.
+ *
+ * All specified paths are the shortest ones in the JTAG spec, and are thus
+ * not (!!) exact matches for the paths used elsewhere in OpenOCD.  Note
+ * that PAUSE-to-PAUSE transitions all go through UPDATE and then CAPTURE,
+ * which has specific effects on the various registers; they are not NOPs.
+ *
+ * Paths to RESET are disabled here.  As elsewhere in OpenOCD, and in XSVF
+ * and many SVF implementations, we don't want to risk missing that state.
+ * To get to RESET, always we ignore the current state.
+ */
+static const svf_statemove_t svf_statemoves[] =
 {
        // from                 to                              num_of_moves,   paths[8]
 //     {TAP_RESET,             TAP_RESET,              1,                              {TAP_RESET}},
 {
        // from                 to                              num_of_moves,   paths[8]
 //     {TAP_RESET,             TAP_RESET,              1,                              {TAP_RESET}},
index b193509550c6cc422f781773bd6a00246f922c0c..083e6e3253343c5076d463190af67d71d65aef90 100644 (file)
@@ -1,31 +1,30 @@
-/***************************************************************************
- *      Copyright (C) 2005 by Dominic Rath                                                                        *
- *      Dominic.Rath@gmx.de                                                                                                       *
- *                                                                                                                                                *
- *      Copyright (C) 2007,2008 Øyvind Harboe                                                            *
- *      oyvind.harboe@zylin.com                                                                                                   *
- *                                                                                                                                                *
- *      Copyright (C) 2008 Peter Hettkamp                                                                         *
- *      peter.hettkamp@htp-tel.de                                                                                         *
- *                                                                                                                                                *
- *      Copyright (C) 2009 SoftPLC Corporation. http://softplc.com             *
- *      Dick Hollenbeck <dick@softplc.com>                                                                        *
- *                                                                          *
- *      This program is free software; you can redistribute it and/or modify   *
- *      it under the terms of the GNU General Public License as published by   *
- *      the Free Software Foundation; either version 2 of the License, or         *
- *      (at your option) any later version.                                                                       *
- *                                                                                                                                                *
- *      This program is distributed in the hope that it will be useful,                   *
- *      but WITHOUT ANY WARRANTY; without even the implied warranty of            *
- *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
- *      GNU General Public License for more details.                                              *
- *                                                                                                                                                *
- *      You should have received a copy of the GNU General Public License         *
- *      along with this program; if not, write to the                                             *
- *      Free Software Foundation, Inc.,                                                                                   *
- *      59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.                         *
- ***************************************************************************/
+/*
+ * Copyright (C) 2005 by Dominic Rath
+ * Dominic.Rath@gmx.de
+ *
+ * Copyright (C) 2007,2008 Øyvind Harboe
+ * oyvind.harboe@zylin.com
+ *
+ * Copyright (C) 2008 Peter Hettkamp
+ * peter.hettkamp@htp-tel.de
+ *
+ * Copyright (C) 2009 SoftPLC Corporation. http://softplc.com
+ * Dick Hollenbeck <dick@softplc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 
 /* The specification for SVF is available here:
 
 
 /* The specification for SVF is available here:
@@ -186,7 +185,7 @@ static int xsvf_read_buffer(int num_bits, int fd, uint8_t* buf)
 
 static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
 
 static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
 {
-       uint8_t *dr_out_buf = NULL;                             /* from host to device (TDI) */
+       uint8_t *dr_out_buf = NULL;                             /* from host to device (TDI) */
        uint8_t *dr_in_buf = NULL;                              /* from device to host (TDO) */
        uint8_t *dr_in_mask = NULL;
 
        uint8_t *dr_in_buf = NULL;                              /* from device to host (TDO) */
        uint8_t *dr_in_mask = NULL;
 
@@ -197,7 +196,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
        tap_state_t     xendir = TAP_IDLE;              /* see page 8 of the SVF spec, initial xendir to be TAP_IDLE */
        tap_state_t xenddr = TAP_IDLE;
 
        tap_state_t     xendir = TAP_IDLE;              /* see page 8 of the SVF spec, initial xendir to be TAP_IDLE */
        tap_state_t xenddr = TAP_IDLE;
 
-       uint8_t                 opcode;
+       uint8_t         opcode;
        uint8_t         uc;
        long            file_offset = 0;
 
        uint8_t         uc;
        long            file_offset = 0;
 
@@ -206,14 +205,14 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
        int             loop_clocks = 0;
        int             loop_usecs = 0;
 
        int             loop_clocks = 0;
        int             loop_usecs = 0;
 
-       int             do_abort = 0;
-       int             unsupported = 0;
-       int             tdo_mismatch = 0;
-       int             result;
+       int             do_abort = 0;
+       int             unsupported = 0;
+       int             tdo_mismatch = 0;
+       int             result;
        int             verbose = 1;
        char*   filename;
 
        int             verbose = 1;
        char*   filename;
 
-       int             runtest_requires_tck = 0;       /* a flag telling whether to clock TCK during waits, or simply sleep, controled by virt2 */
+       int             runtest_requires_tck = 0;       /* a flag telling whether to clock TCK during waits, or simply sleep, controled by virt2 */
 
 
        /* use NULL to indicate a "plain" xsvf file which accounts for
 
 
        /* use NULL to indicate a "plain" xsvf file which accounts for
@@ -500,7 +499,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
                                LOG_DEBUG("XSTATE 0x%02X %s", uc, tap_state_name(mystate));
 
 
                                LOG_DEBUG("XSTATE 0x%02X %s", uc, tap_state_name(mystate));
 
-                               /*      there is no need for the lookahead code that was here since we
+                               /*      there is no need for the lookahead code that was here since we
                                        queue up the jtag commands anyway.  This is a simple way to handle
                                        the XSTATE.
                                */
                                        queue up the jtag commands anyway.  This is a simple way to handle
                                        the XSTATE.
                                */
@@ -654,7 +653,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                case XCOMMENT:
                        {
                                unsigned int ndx = 0;
                case XCOMMENT:
                        {
                                unsigned int ndx = 0;
-                               char    comment[128];
+                               char    comment[128];
 
                                do
                                {
 
                                do
                                {
@@ -687,7 +686,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
 
                                tap_state_t wait_state;
                                tap_state_t end_state;
 
                                tap_state_t wait_state;
                                tap_state_t end_state;
-                               int     delay;
+                               int     delay;
 
                                if (read(xsvf_fd, &wait, 1) < 0
                                  || read(xsvf_fd, &end, 1) < 0
 
                                if (read(xsvf_fd, &wait, 1) < 0
                                  || read(xsvf_fd, &end, 1) < 0
@@ -723,7 +722,7 @@ static int handle_xsvf_command(struct command_context_s *cmd_ctx, char *cmd, cha
                                */
 
                                uint8_t  clock_buf[4];
                                */
 
                                uint8_t  clock_buf[4];
-                               uint8_t         usecs_buf[4];
+                               uint8_t usecs_buf[4];
                                uint8_t wait;
                                uint8_t end;
                                tap_state_t wait_state;
                                uint8_t wait;
                                uint8_t end;
                                tap_state_t wait_state;

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)