Commit Graph

57 Commits

Author SHA1 Message Date
Antonio Borneo 96202cda19 openocd: build: add SPDX tag
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
2022-07-23 13:06:38 +00:00
Antonio Borneo 12e2dfd31f Makefile: drop warning suppression on win build
Commit dcdf71c21b ("- fix signed/unsigned build errors under
win32. Thanks Zach Welch <zw@superlucidity.net>") in 2009 prevents
gcc warnings on sign/unsigned comparisons while building for Win
on folders 'helper' and 'server'.
In 2011, commit b69119668e ("RTOS Thread awareness support wip")
uses the same method on the new folder 'rtos'.

In mean time, all the incorrect sign/unsigned comparisons has been
fixed and no warning is present with the default -Wextra flag that
implies -Wsign-compare.
The comment:
	# FD_* macros are sloppy with their signs on MinGW32 platform
seems linked to some old implementation of MinGW32 include file
that doesn't apply on current versions.

Remove the obsolete hacks to suppress the warnings.

Change-Id: I76dba9e54a647d3b9fbf1b7e9ae1844e3d7adc9a
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6254
Tested-by: jenkins
Reviewed-by: Xiaofan Chen <xiaofanc@gmail.com>
2021-08-30 13:52:12 +00:00
Antonio Borneo b3a51bbb59 helper: remove fix for libusb pre-v1.0.9
Libusb v1.0.9 has been released on April 2012. We can reasonably
expect that every user has already updated his system to a libusb
newer of equel to v1.0.9.

Remove the fix for older libusb.

Change-Id: I0c40e53d7af85a11b0bb265bbf8035857a2dfce1
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6253
Tested-by: jenkins
Reviewed-by: Xiaofan Chen <xiaofanc@gmail.com>
2021-08-30 13:51:46 +00:00
Antonio Borneo 9544cd653d helper: add align.h
OpenOCD has to often align values or check for alignment.
Use a dedicated set of macros instead of reinventing the wheel
each time.

Change-Id: Ia58711608aae0801deeaccb5f33148f2073b0bbd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6374
Tested-by: jenkins
Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
2021-08-14 13:29:43 +01:00
Antonio Borneo 58b95eac48 ioutil: drop the code, deprecated in v0.10.0
The code for ioutil has been marked as deprecated in release
v0.10.0, 4 years ago.

Time to drop it!

Change-Id: I36dce1669ebe9acada5f9e752835c53e5214e3be
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6089
Tested-by: jenkins
2021-03-19 21:55:23 +00:00
Antonio Borneo e5177a5ad4 helper: add bitmap helper primitives
Mainly copied/inspired from Linux kernel code in
- include/linux/types.h
- include/linux/bitmap.h
- include/linux/bitops.h

Change-Id: I317b542993ab81530c86553f339b79505d0fef0f
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/4894
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2019-06-06 16:32:57 +01:00
Andreas Fritiofson 7436f7c2c0 helper,rtos,server: Restore missing warning flags
These libraries override the used CFLAGS without adding the
defaults. This didn't have any effect until change
http://openocd.zylin.com/3870 (ef4c139). Restore by adding
AM_CLAGS to the per-target CFLAGS.

Interestingly, automake seems to clear the CFLAGS for the target
even if the override variable is only mentioned within a non-active
conditional branch, such as the IS_MINGW for the affected libraries.

Change-Id: I805206865e59e3fa33a7ea3c0d3472e51219351c
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3927
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2017-01-15 10:16:16 +00:00
Andreas Fritiofson 5be455a710 Convert to non-recursive make
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-12-08 16:23:10 +00:00
Andreas Fritiofson 1919dbbfd2 helper: Add converter from JEP106 ID to manufacturer name
Use it to print the manufacturer of detected TAPs

Change-Id: Ic4384c61c7f6f7ae2a9b860a805a5997542f72cc
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3177
Tested-by: jenkins
Reviewed-by: Jiri Kastner <cz172638@gmail.com>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-01-22 15:02:16 +00:00
Paul Fertser f1b04a20dc Provide od+sed replacement for the bin2char helper
Using custom build-time tools is always more problematic, especially
for cross-compiling.

This alternative implementation assumes "od" (IEEE Std 1003.1-2001)
and sed are available which should be the case for any reasonably
modern system.

Change-Id: I0208f475648c78e7dca127ff4bab60d314b2bf53
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2139
Tested-by: jenkins
Reviewed-by: Fatih Aşıcı <fatih.asici@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-08-02 09:00:28 +00:00
Paul Fertser 191a5736c2 libusb: require pkg-config support
An alternative approach to show how much cleaner the pure pkg-config
way is.

This changes the discovery procedures for libusb-1.0 and libusb-0.1,
making them depend on pkg-config being properly installed and
configured, including the necessary build host configuration for the
cross-builds (see
http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/cross-compiling.html)

It should make it possible to compile OpenOCD without changes and
extra effort on GNU/Linux, FreeBSD users would need to supply a .pc
file for their libusb implementation or add LIBUSB1_LIBS and
LIBUSB1_CFLAGS to the configure environment.

Change-Id: I826e378dd1e0d101a549a573b2c63212a7e00b64
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1467
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Tested-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-13 21:43:18 +00:00
Andreas Fritiofson 6d639b09f0 Add a bit-level transfer queue
Interface drivers regularly need to keep track of where each part of a long
read buffer should be copied, once that data arrives. Both source and
destination are often at an arbitrary bit offset.

This queued bit-level copy can help with that, by allowing the driver to
perform postponed reads from the receive buffer already when building the
transmit buffer, and have those reads executed at a later time when data is
available.

For simplicity, it uses the linked list implementation list.h imported from
the Linux kernel.

Change-Id: I06862a0a6f057cbbcacfb021f17a795195faded2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/450
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Peter Stuge <peter@stuge.se>
2012-07-06 14:58:25 +00:00
Øyvind Harboe 39650e2273 ecosboard: delete bit-rotted eCos code
Change-Id: Iff7943eb9da3f41dcc45492acd0f36cf63b3497f
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/503
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Tested-by: jenkins
2012-03-13 19:11:11 +00:00
Steve Bennett ef885d3b2a jim-nvp is moving from jimtcl to openocd
The jim-nvp code is specific to openocd, so it belongs in openocd,
not in the core jimtcl.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
2011-09-30 09:38:22 +02:00
Spencer Oliver 838cd58e24 build: add common.mk
Rather than specifying common makefile variables move
them all to a common.mk.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-11-18 14:05:56 +00:00
Øyvind Harboe 559d08c19e jim tests: use installed
Delete obsolete jim that comes with OpenOCD.
2010-10-29 15:10:51 +02:00
Øyvind Harboe 630fc86ee3 util: ms command to calculate length of operations
This can be used to calculate approximate RTCK frequency
for instance.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2010-08-01 09:35:58 +02:00
Antonio Borneo b89462d7dc helper: remove helper membuf
Helper is now unused. Can be removed.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
2010-06-17 07:20:42 +02:00
Øyvind Harboe c8b8a34bb5 ecos: crisper implementation of timeval_ms()
A crisper/faster implementation under eCos that makes profiling a
tad easier.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-16 08:15:05 +01:00
Øyvind Harboe eb1bc657ae build: add build/src to include path
This allows including generated include files.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-12-08 10:16:10 +01:00
Zachary T Welch 822c06d9e3 remove tertiary include paths
With all #include directives converted, we only need to have the
top-level src/ directory in the search path.
2009-12-03 04:24:50 -08:00
Zachary T Welch 896ac8d4ef allow #include directives to use module name
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-12-03 01:54:15 -08:00
Zachary T Welch eaf10f69de remove BUILD_IOUTIL symbol
Add ioutil_stubs.c to provide an empty ioutil_init() routine.
Add ioutil.h to prevent applications from needing to declare it.

Allows unconditionally calling that function during startup, and the
resulting libocdhelper library API is now more stable.

Prints a DEBUG message when the stub implementation is included.
2009-12-02 13:26:26 -08:00
Zachary T Welch cb7dbc1af4 split startup.tcl file across modules
Moves definitions for each layer into their own file, eliminating
layering violations in the built-in TCL code.  Updates src/Makefile.am
rules to include all files in the final startup.tcl input file, and
others Makefile.am rules to distribute the new files in our packages.
2009-11-18 07:21:42 -08:00
Zachary T Welch 903daa796a move startup.c to libopenocd
Moves the creation of startup_tcl.c from src/helper/ to src/.
Prepares to split the startup.tcl file into its per-module parts.
2009-11-18 03:59:14 -08:00
David Brownell cb7965da15 xscale: better fix for debug_handler.bin
Generate a C struct with the data, and use that, instead of an
assembly language file.  The assembly language causes issues on
Darwin and MS-Windows, which don't necessarily use GNU AS; or
if they do, don't necessarily use its ELF syntax.

It's also better in two other ways:  fewer global symbols; and
the init-time size check gets optimized away at compile time.
(Unless it fails, in which case bigger chunks of the file vanish.)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-10-16 13:52:40 -07:00
dbrownell 86a7d813a1 Remove annoying end-of-line whitespace from most src/*
files; omitted src/httpd


git-svn-id: svn://svn.berlios.de/openocd/trunk@2742 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-09-21 18:40:55 +00:00
duane 176b5600ed Add a growable sprintf memory buffer library
git-svn-id: svn://svn.berlios.de/openocd/trunk@2381 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-24 01:54:25 +00:00
zwelch 00228aa839 Fix make maintainer-clean for out-of-tree builds.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2172 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-09 10:28:16 +00:00
zwelch e8e0af3956 Whitespace-only updates to automake input files:
- use continuations to break long lines of variable assignments
- makes these variables more patch-friendly and conform to style guide


git-svn-id: svn://svn.berlios.de/openocd/trunk@1970 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-31 12:10:57 +00:00
zwelch dd86b54e6e Update build system to find moved scripts -- Step 3 of 2:
- Update references from using PKGLIBDIR to PKGDATADIR.
- Update built-in script search paths to reflect new install location:
  - $(pkgdatadir)       =>   $(pktdatadir)/site
  - $(pkglibdir)        =>   $(pktdatadir)/scripts
- Update installed location of httpd files:
  - $(pkglibdir)/httpd   =>   $(pkgdatadir)/httpd


git-svn-id: svn://svn.berlios.de/openocd/trunk@1920 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-27 07:49:58 +00:00
zwelch af7cdfd82b Factor system #includes out of replacements.h into new system.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1702 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 02:52:00 +00:00
zwelch 647e61cc6d Extend autotools build to create shared library libopenocd with libtool:
- Add libtoolize step too bootstrap script; creates ltmain.sh script.
- Add AC_PROG_LIBTOOL to configure.in to add libtool support to build.
- Change Makefile.am library rules from static (_a) to libtool (_la).
- Install libopenocd.{la,so,a} in $(libdir); update openocd link rules.
- Extend MAINTAINERCLEANFILES in top-level Makefile.am to remove ltmain.sh.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1695 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 22:03:57 +00:00
zwelch 104580e0bf Reverse revision 1691: all of its functionality has migrated elsewhere.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1694 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 21:33:53 +00:00
zwelch 72acdac71a Revive tclapi.c from r1650:
* Remove superfluous #include directives.
* Fix warnings and API usage to cure its bit rot.
* Build into libhelper library (for now).
Add tclapi.h to export tclapi_register_commands().
Register tclapi commands in openocd.c:setup_command_handler().



git-svn-id: svn://svn.berlios.de/openocd/trunk@1691 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-10 19:44:38 +00:00
zwelch 66add57aa5 Update autotools scripts to require automake 1.6. The configure.in script
already required autoconf 2.59 (circa 2006), so there is no reason to
support versions of automake older than 1.6 (circa 2002).

The first part of this patch upgrades the configure.in script:

     1. Use current calling conventions for the AC_INIT and
        AM_INIT_AUTOMAKE macros, bringing their usage up-to-date with
        the version of autoconf already specified by AC_PREREQ.
     2. Add AC_CONFIG_SRCDIR macro, required by new version of AC_INIT.
     3. Automatically enable all of automake's warnings except Makefile
        portability (which OpenOCD violates by using GNU make's $(wildcard)).
        [[ While automake has its own -Werror option, I did not enabled it
        due to existing warnings. ]]
     4. Add the missing AM_PROG_C_O check, required by the build rules for
        openocd.o in src/Makefile.am.
     5. Adjust version number to show progress toward the next release.
     6. Include a bug reporting e-mail address to direct users to this list.

This patch makes the following adjustments to the Makefile.am files:

     1. Update AUTOMAKE_OPTIONS to require automake version 1.6
     2. Rewrite all deprecated INCLUDES assignments as AM_CPPFLAGS
     3. Clean-up all AM_CPPFLAGS declarations to be patch-friendly.
     4. Remove vestigial references to $(all_includes)
     5. Remove erroneous references to @CPPFLAGS@ (only use AM_CPPFLAGS)
     6. Remove unused -I and -D directives in helper/, flash/, target/


git-svn-id: svn://svn.berlios.de/openocd/trunk@1591 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-02 22:35:02 +00:00
ntfreak dcdf71c21b - fix signed/unsigned build errors under win32. Thanks Zach Welch <zw@superlucidity.net>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1489 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-21 09:02:42 +00:00
kc8apf 93180753be Fix 'make maintainer-clean' courtesy of Zach Welch <zw@superlucidity.net>
git-svn-id: svn://svn.berlios.de/openocd/trunk@1345 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-20 03:55:38 +00:00
oharboe a98e1094a0 sync up to tap_xxx rename + add with-ioutil for standalone openocd implemetnations
git-svn-id: svn://svn.berlios.de/openocd/trunk@1243 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15 11:32:22 +00:00
ntfreak 47d0449347 - add ability for openocd to communicate to gdb using pipes (stdin/stdout).
- this is enabled by new command line option option --pipe.

git-svn-id: svn://svn.berlios.de/openocd/trunk@1242 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-15 09:43:26 +00:00
oharboe b1cf5423ef "Theodore A. Roth" <taroth@gmail.com> fixes to distcheck
git-svn-id: svn://svn.berlios.de/openocd/trunk@1199 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-01 19:55:55 +00:00
oharboe 7e02ebfd62 place event loop inside #ifdef JIM_EMBEDDED.
git-svn-id: svn://svn.berlios.de/openocd/trunk@903 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-11 08:27:04 +00:00
oharboe c76b0618d7 David Kuehling <dvdkhlng@gmx.de> - added jim-eventloop.c
git-svn-id: svn://svn.berlios.de/openocd/trunk@898 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-08-07 16:37:20 +00:00
oharboe 7ccfcdea0b Spen: startup.tcl cross compile support
git-svn-id: svn://svn.berlios.de/openocd/trunk@856 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-22 11:06:09 +00:00
oharboe c1ee650a9a cross compile fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@848 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-21 13:23:59 +00:00
ntfreak 60ba4476df - fix incorrectly registered function openocd_array2mem
- removed unused variables
- reformatted lpc288x.[ch]
- fixed helper/Makefile.am dependencies
- add correct svn props to added files

git-svn-id: svn://svn.berlios.de/openocd/trunk@829 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-18 11:38:23 +00:00
oharboe 8a14a72f57 Charles Hardin <ckhardin@gmail.com> move jim into helper
git-svn-id: svn://svn.berlios.de/openocd/trunk@822 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-17 17:34:53 +00:00
oharboe 69c6f1f7ea work in progress to improve help
git-svn-id: svn://svn.berlios.de/openocd/trunk@792 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-11 15:07:58 +00:00
oharboe c5b718f5e8 - retired variable stuff.
- drscan is now a low level tcl command:
 execute DR scan <device> <num_bits> <value> <num_bits1> <value2> 
- removed obsolete partial command text support

git-svn-id: svn://svn.berlios.de/openocd/trunk@791 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-11 12:17:56 +00:00
oharboe 0313c59555 reduce compare noise. If someone should be crazy enough to try to run OpenOCD under eCos, then they'v got some hooks to point them in the general direction.
git-svn-id: svn://svn.berlios.de/openocd/trunk@499 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-11 21:32:03 +00:00