aboutsummaryrefslogtreecommitdiff
path: root/src/xsvf
AgeCommit message (Collapse)AuthorFilesLines
2022-09-18openocd: fix SPDX tag format for files .cAntonio Borneo1-1/+1
With the old checkpatch we cannot use the correct format for the SPDX tags in the file .c, in fact the C99 comments are not allowed and we had to use the block comment. With the new checkpatch, let's switch to the correct SPDX format. Change created automatically through the command: sed -i \ 's,^/\* *\(SPDX-License-Identifier: .*[^ ]\) *\*/$,// \1,' \ $(find src/ contrib/ -name \*.c) Change-Id: I6da16506baa7af718947562505dd49606d124171 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7153 Tested-by: jenkins
2022-07-23openocd: src: replace the GPL-2.0-or-later license tagAntonio Borneo2-26/+4
Replace the FSF boilerplate with the SPDX tag. The SPDX tag on files *.c is incorrect, as it should use the C99 single line comment using '//'. But current checkpatch doesn't allow C99 comments, so keep using standard C comments, by now. Change-Id: I30cd66ac7d737f1973c68fdbb841ffcf00e917c4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7072 Tested-by: jenkins
2022-07-23openocd: build: add SPDX tagAntonio Borneo1-0/+2
Add the SPDX tag to makefiles, configuration scripts and tcl files present in the folders under src/ Change-Id: I1e4552aafe46ef4893d510da9d732c5f181784a4 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7051 Tested-by: jenkins
2021-07-24openocd: fix simple cases of NULL comparisonAntonio Borneo1-3/+3
There are more than 1000 NULL comparisons to be aligned to the coding style. For recurrent NULL comparison it's preferable using trivial scripts in order to minimize the review effort. Patch generated automatically with the command: sed -i PATTERN $(find src/ -type f) where PATTERN is in the list: 's/(\([a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(\1)/g' Change-Id: Ida103e325d6d0600fb69c0b7a1557ee969db4417 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6350 Tested-by: jenkins
2021-05-22openocd: fix some minor typoAntonio Borneo1-1/+1
Minor typos found by the new checkpatch boosted by the dictionary provided by 'codespell'. Change-Id: I7b4cae1798ff5ea048fcbc671a397af763fdc605 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6218 Tested-by: jenkins
2021-05-01Cleanup of config/includes.Tim Newsome1-0/+1
Remove a use of AH_BOTTOM from configure.ac. This macro is used by autoheader to add '#include' of some include file to the end of config.h.in and then to config.h. OpenOCD can be built with a custom config.h, so it's preferable to move these '#include' statement directly in the C files that need them dropping this unneeded dependency. It also causes problems when I want to use the gnulib library (which comes with its own Makefile, and does not have the same include path as the top-level Makefile). So this change touches a lot of files, but is actually really simple. It does not affect functionality at all. Change-Id: I52c70bf15eb2edc1dd10e0fde23b2bcd4caec000 Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: http://openocd.zylin.com/6171 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-09-05openocd: avoid checking for non NULL pointer to free itAntonio Borneo1-14/+6
The function free() can be called with a NULL pointer as argument, no need to check the argument before. If the pointer is NULL, no operation is performed by free(). Remove the occurrences of pattern: if (ptr) free(ptr); While there replace a sequence malloc(size)+memset(,0,size) with a calloc(1,size). Replace a pointer assignment to '0' with an assignment to NULL. In server/*, an error is logged if the ptr was already NULL. This cannot happen since the pointer was already referenced few lines before and openocd would have been already SIGSEGV in that case, so remove the log. Change-Id: I10822029fe8390b59edff4070575bf7f754e44ac Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5808 Reviewed-by: Adrian M Negreanu <adrian.negreanu@nxp.com> Tested-by: jenkins
2020-07-26xsvf: fix minor typosAntonio Borneo1-4/+4
Change-Id: Ib36b2178eacf79dd26ebd2e15ba385853825c198 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5765 Tested-by: jenkins
2020-01-16xsvf: fix memory leakTomas Vanek1-1/+3
Discovered by clang static analyzer. Change-Id: I2980586aea5ee43226adb1f4cf72e7ba1dfddd83 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5372 Tested-by: jenkins Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2019-05-14helper/command: change prototype of command_print/command_print_samelineAntonio Borneo1-6/+6
To prepare for handling TCL return values consistently, all calls to command_print/command_print_sameline should switch to CMD as first parameter. Change prototype of command_print() and command_print_sameline() to pass CMD instead of CMD_CTX. Since the first parameter is currently not used, the change can be done though scripts without manual coding. This patch is created using the command: sed -i PATTERN $(find src/ doc/ -type f) with all the following patters: 's/\(command_print(cmd\)->ctx,/\1,/' 's/\(command_print(CMD\)_CTX,/\1,/' 's/\(command_print(struct command_\)context \*context,/\1invocation *cmd,/' 's/\(command_print_sameline(cmd\)->ctx,/\1,/' 's/\(command_print_sameline(CMD\)_CTX,/\1,/' 's/\(command_print_sameline(struct command_\)context \*context,/\1invocation *cmd,/' This change is inspired by http://openocd.zylin.com/1815 from Paul Fertser but is now done through scripting. Change-Id: I3386d8f96cdc477e7a2308dd18269de3bed04385 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/5081 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2016-12-08Convert to non-recursive makeAndreas Fritiofson1-8/+2
Change-Id: I11f8bc8553957e2ff083c09e72e16881e4d3bb6f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/3865 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-05-24Make #include guard naming consistentMarc Schink1-3/+3
Change-Id: Ie13e8af0bb74ed290f811dcad64ad06c9d8cb4fa Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/2956 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-05-24Remove FSF address from GPL noticesMarc Schink2-6/+2
Also make GPL notices consistent according to: https://www.gnu.org/licenses/gpl-howto.html Change-Id: I84c9df40a774958a7ed91460c5d931cfab9f45ba Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/3488 Tested-by: jenkins Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2015-11-30xsvf: output a warning suggesting using SVFPaul Fertser1-0/+1
Change-Id: Iff13019aa96c528268a2be029b4acd65a00a598e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2907 Tested-by: jenkins
2013-06-05update files to correct FSF addressSpencer Oliver2-2/+2
Change-Id: I429f7fd51f77b0e7c86d7a7f110ca31afd76c173 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1426 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2012-02-06build: cleanup src/xsvf directorySpencer Oliver2-474/+451
Change-Id: I5325980b240fba841d8cce81985f4da369ad9052 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/410 Tested-by: jenkins
2012-01-12xsvf: fix clang warningSpencer Oliver1-1/+1
clang reports 'Function call argument is an uninitialized value'. Change-Id: I50f4a7932b59930a5f1e3ece70b12c59e85ea3c6 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/360 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-04Change return value on error.Mathias K1-2/+1
On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K <kesmtp@freenet.de> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-07xsvf: add missing error propagationØyvind Harboe1-2/+21
Change-Id: Ibc70deb980d6d18ceb376b72d9104e6180b16acf Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/176 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-01-05nit: do not add \n at end of LOG_ERROREric Wetzel1-9/+9
Fixed in many other places, and submitted in response to Øyvind's invitation.
2010-11-18build: add common.mkSpencer Oliver1-3/+1
Rather than specifying common makefile variables move them all to a common.mk. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-06-22xsvf: Fix shadow issues on MacEdgar Grimberg1-6/+6
wait is declared in /usr/include/sys/wait.h Signed-off-by: Edgar Grimberg <edgar.grimberg@zylin.com>
2010-06-21jtag: do not use jtag_get_error()Øyvind Harboe1-1/+1
normal code should not call jtag_get_error(), but rather check the return code from jtag_execute_queue(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-06-16xsvf: -Wshadow warning fixesØyvind Harboe1-2/+0
I think this fixed an error message where the error message would show the *previous* uc code rather than the current unsupported uc code. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-18jtag: cut down on usage of unintended modification of global end stateØyvind Harboe1-4/+4
jtag_get/set_end_state() is now deprecated. There were lots of places in the code where the end state was unintentionally modified. The big Q is whether there were any places where the intention was to modify the end state. 0.5 is a long way off, so we'll get a fair amount of testing. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: simplify jtag_add_plain_ir/dr_scanØyvind Harboe1-3/+6
These fn's now clearly just clock out/in bits. No mystical fields are involved. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: jtag_add_ir_scan() now takes a single fieldØyvind Harboe1-1/+1
In the code a single field was all that was ever used. Makes jtag_add_ir_scan() simpler and leaves more complicated stuff to jtag_add_plain_ir_scan(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-03-08jtag: retire tap fieldØyvind Harboe1-6/+3
jtag_add_dr/ir_scan() now takes the tap as the first argument, rather than for each of the fields passed in. The code never exercised the path where there was more than one tap being scanned, who knows if it even worked. This simplifies the implementation and reduces clutter in the calling code. use jtag_add_ir/dr_plain_scan() for more fancy situations. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-01-08*SVF: help/usage updatesDavid Brownell1-2/+2
Usage messages should use the same EBNF as the User's Guide; no angle brackets. Be more complete too ... some params were missing. Don't use "&function"; its name is its address. Unrelated: fix typo in one "target.c" usage message. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-08build: add build/src to include pathØyvind Harboe1-1/+2
This allows including generated include files. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-03remove tertiary include pathsZachary T Welch1-5/+1
With all #include directives converted, we only need to have the top-level src/ directory in the search path.
2009-12-03change #include "svf.h" to <svf/svf.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "svf.h" the following form should be used. #include <svf/svf.h> The exception is from .c files in the same directory.
2009-12-03change #include "jtag.h" to <jtag/jtag.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "jtag.h" the following form should be used. #include <jtag/jtag.h> The exception is from .c files in the same directory.
2009-12-03change #include "command.h" to <helper/command.h>Zachary T Welch1-1/+1
Changes from the flat namespace to heirarchical one. Instead of writing: #include "command.h" the following form should be used. #include <helper/command.h> The exception is from .c files in the same directory.
2009-12-03allow #include directives to use module nameZachary T Welch1-0/+1
Includes the src directory in the search path, so header files may be migrated from: #include "foo.h" to #include <module/foo.h> which is more conducive for installation.
2009-11-24{,x}svf: use register_commands()Zachary T Welch1-5/+15
Use register_commands() for registering {,x}svf commands.
2009-11-24use COMMAND_REGISTER macroZachary T Welch1-1/+1
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
2009-11-17command_handler: change 'cmd_ctx' to CMD_CTXZachary T Welch1-7/+7
Convert all command handler 'cmd_ctx' parameter usage with CMD_CTX.
2009-11-17command_handler: change 'args' to CMD_ARGVZachary T Welch1-8/+8
This patch converts all instances of 'args' in COMMAND_HANDLER routines to use CMD_ARGV macro.
2009-11-17command_handler: change to 'argc' to CMD_ARGCZachary T Welch1-4/+4
This patch converts all instances of 'argc' in COMMAND_HANDLER routines to use CMD_ARGC.
2009-11-16move ARRAY_SIZE macro to types.hZachary T Welch1-1/+1
The ARRAY_SIZE macro was defined in several target files, so move it to types.h. This patch also removes two other identical macros: DIM (from jtag.h) and asizeof (from arm11.h).
2009-11-16rename CEIL as DIV_ROUND_UPZachary T Welch1-2/+2
Improves the name of this macro, moves it to types.h, and adds a block of Doxygen comments to describe what it does.
2009-11-13command_context_t -> struct command_contextZachary T Welch2-2/+2
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13scan_field_t -> struct scan_fieldZachary T Welch1-3/+3
Remove useless structure typedef.
2009-11-13jtag_tap_t -> struct jtag_tapZachary T Welch1-1/+1
Search and destroy the jtag_tap_t typedef. This also cleans up a layering violation, removing the declaration from types.h.
2009-11-13use COMMAND_HANDLER macro to define all commandsZachary T Welch1-1/+1
2009-11-11add const keyword to some APIsZachary T Welch1-2/+2
Add 'const' keyword to 'char *' parameters to allow command handlers to pass constant string arguments. These changes allow the 'args' command handler to be changed to 'const' in a subsequent patch.
2009-11-09svf,xsvf,arm7_9_common: trim forard declarationsZachary T Welch1-9/+8
Remove forward declarations by reordering command registration.
2009-11-09src/{server,pld,svf,xsvf}: remove 'extern' keywordZachary T Welch1-1/+1
Removes 'extern' keyword from function declarations in header filess.
2009-10-29XSVF: bugfix handling state pathsDavid Brownell1-15/+100
Implement XSVF support for detailed state path transitions, by collecting sequences of XSTATE transitions into paths and then calling pathmove(). It seems that the Xilinx tools want to force state-by-state transitions instead of relying on the standardized SVF paths. Like maybe there are XSVF tools not implementing SVF paths, which are all that we support using svf_statemove(). So from IRPAUSE, instead of just issuing "XSTATE DRPAUSE" they will issue XSTATES for each intermediate state: first IREXIT2, then IRUPDATE, DRSELECT, DRCAPTURE, DREXIT1, and finally DRPAUSE. This works now. Handling of paths that go *through* reset is a trifle dodgey, but it should be safe. Tested-by: Wookey <wookey@wookware.org> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>