Commit Graph

55 Commits

Author SHA1 Message Date
Antonio Borneo 533f0f1b87 openocd: src/helper: replace the GPL-2.0-or-later license tag
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: I7851617e2682f97ccc3927e3941aadef2df63b54
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7068
Tested-by: jenkins
2022-07-23 13:54:09 +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
Tim Newsome 87c90393fe Cleanup of config/includes.
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>
2021-05-01 14:35:09 +01:00
Antonio Borneo ae86bd8e18 helper/replacements: remove unused typedef's
The ELF typedef's 'Elf32_Sword' and 'Elf32_Hashelt' are not used
within OpenOCD. Plus, being their name in CamelCase require extra
effort to include them in the exceptions for checkpatch.

Remove the unused typedef's.

Change-Id: I18f039567edd5b24dbb41df5406c154f31022ae7
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/6178
Tested-by: jenkins
Reviewed-by: Christian Hoff <christian.hoff@advantest.com>
2021-05-01 13:36:43 +01:00
Florian Meister 9206bd243b target/image: allow loading of 64-bit ELF files
Change-Id: I9b88edacf5ffcc3c1caeab8c426693de0d92a695
Signed-off-by: Florian Meister <florian.meister@advantest.com>
Signed-off-by: Christian Hoff <christian.hoff@advantest.com>
Reviewed-on: http://openocd.zylin.com/5204
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Ooi, Cinly <cinly.ooi@intel.com>
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2021-05-01 13:36:15 +01:00
Marc Schink 703ce2e941 helper/replacements.h: Add missing #include
Change-Id: Ic6c47f7fbc999d00ef3211c1fa44867e3aabc321
Signed-off-by: Marc Schink <openocd-dev@marcschink.de>
Reviewed-on: http://openocd.zylin.com/4057
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2018-03-07 23:43:58 +00:00
Tim Newsome 64f1f7b1c1 Add read buffer to bitbang, improving performance.
Previously for every bit scanned OpenOCD would write the bit, wait for
that bit to be scanned, and then read the result. This involves at least
2 context switches. Most of the time the next bit scanned does not
depend on the last bit we read, so with a buffer we now write a bunch of
bits to be scanned all at once, and then we wait for them all to be
scanned and have a result.

This reduces the time for one testcase where OpenOCD connects to a
simulator from 12.30s to 5.35s!

Running all our tests went from 13m13s to 3m55s.

Change-Id: Ie9fcea043ac1d7877a521125334ed47d4b3e1615
Signed-off-by: Tim Newsome <tim@sifive.com>
Reviewed-on: http://openocd.zylin.com/4312
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2018-01-25 16:44:06 +00:00
Marc Schink d4b7cbff88 Make #include guard naming consistent
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-24 22:30:55 +01:00
Marc Schink d0e763ac7e Remove FSF address from GPL notices
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>
2016-05-24 22:30:01 +01:00
Paul Fertser c9639ae2ac configure: define WIN32_LEAN_AND_MEAN early to make it effective
This macro makes windows builds faster and helps with the old "#define
interface struct" issue as the word "interface" is part of libusb-0.1
API. However, defining it in replacements.h is too late, as windows.h
gets included by that time from somewhere else.

This solution is provided by Ray Donnelly from the MSYS2 team.

Change-Id: I376a5fb3d106786515d7e1ba44dbd751e4dcdb1b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2486
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-02-04 21:56:55 +00:00
Paul Fertser 71ee5f6b5f libusb1_common, ftdi: clarify libusb_open error message
Print a user-friendly message when libusb_open() fails, e.g.
Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
when there's a permissions problem.

Also output a configure warning if libusb older than 1.0.9 is detected.

Change-Id: I800f71f06672fe06c0a98a4e469f853b5021bcfe
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1430
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-12 14:40:16 +00:00
Spencer Oliver 08d4411b59 update files to correct FSF address
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>
2013-06-05 19:52:42 +00:00
Spencer Oliver 7bfcc10839 build: add helper/types.h to config.h
this header is used in numerous files and adding to config.h
simplifies its use globally.

Change-Id: Id724a9950b90504721233022c7fb5768e9bc5548
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/649
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2012-05-21 16:15:26 +00:00
Spencer Oliver 8cb0dae823 remote_bitbang: fix native windows build
Change-Id: Ied29ade0346c4595ffc1dafa788e2d5a595e0de3
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/648
Tested-by: jenkins
Reviewed-by: Xiaofan <xiaofanc@gmail.com>
2012-05-19 20:27:56 +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
Spencer Oliver 8b00e56e64 build: cleanup src/helper directory
Change-Id: I71a312df783995e9083c345c25e73902d5aef59e
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/415
Tested-by: jenkins
2012-02-06 10:49:52 +00:00
Spencer Oliver 7e2257663d build: fix mingw build issues
8901fca027 broke the build under mingw, this
fixes that.

Change-Id: I22b91e220dac3b68cc576b65a9f1b8711e64263a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/298
Tested-by: jenkins
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-12-31 12:23:55 +00:00
Spencer Oliver 75cfda4cd1 ARM semihosting: win32 and cygwin fixes
Cygwin would fail to reopen a previously written file if the mode is
not given.

Simplified converting the open flags and made sure the win32 O_BINARY
bit is set.

Added define for systems that do not support O_BINARY.

Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
2010-01-28 21:05:09 +00:00
Zachary T Welch df0e90ec8c change #include "types.h" to <helper/types.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "types.h"

the following form should be used.

	#include <helper/types.h>

The exception is from .c files in the same directory.
2009-12-03 04:22:52 -08:00
Zachary T Welch 1712d7835e src/helper: wrap and clean headers.
Remove all useless 'extern' keywords from function prototypes.
Wraps long lines for readability.
2009-11-09 09:44:33 -08:00
oharboe 8b994145b8 Andreas Fritiofson <andreas.fritiofson@gmail.com> UTF8 fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@2549 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-17 19:54:25 +00:00
ntfreak d41f2bfb14 - fix build when using a cross compiler - do not try and run any host tools
- add missing types.h when platform does not contain elf.h

git-svn-id: svn://svn.berlios.de/openocd/trunk@2482 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-07-06 15:19:10 +00:00
zwelch dc575dc5bf Remove whitespace that occurs before ')'.
- Replace '[ \t]*[)]' with ')'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2377 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:47:42 +00:00
zwelch f90d8fa45f Remove whitespace that occurs after '('.
- Replace '([ \t]*' with '('.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2376 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:46:23 +00:00
zwelch 6d1d58a1fc - Fixes '[<>]' whitespace
- Replace ')\([<>]\)(' with ') \1 ('.
- Replace ')\([<>]\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\([<>]\)(' with '\1 \2 ('.
- Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2375 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-23 22:45:47 +00:00
ntfreak 14f3548ff2 - fix build issue when HAVE_ELF_H is not defined
git-svn-id: svn://svn.berlios.de/openocd/trunk@1764 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 10:47:48 +00:00
zwelch f976af56a4 Audit and remove redundant uses of replacements.h in the tree.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1761 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 08:35:17 +00:00
zwelch dd85eebf22 Make system.h private by including it from config.h autoheader.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1759 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-12 08:24:47 +00:00
zwelch e2598f06fd Remove redundant config.h from replacements.h, obtained from types.h.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1717 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 05:33:39 +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 1de959ca1c Remove redundant declarations to allow building with -Wredundant-decls.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1560 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 01:43:01 +00:00
zwelch 55c39bae67 Add missing header files to fix C99 compatibility.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1559 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 00:33:35 +00:00
ntfreak 5fbfbec86b - fix win32 build after svn 1511 changes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1513 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-22 19:54:03 +00:00
ntfreak ab87627c5c - add gdb pipe support to native win32 (--pipe option)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1294 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-01-01 16:06:46 +00:00
ntfreak 9d1f95e01a - fix rlink build under native win32 (mingw)
- remove rlink build warnings
- add usb_set_configuration to rlink_init, win32 requires this
- add win32 ETIMEDOUT define

git-svn-id: svn://svn.berlios.de/openocd/trunk@1260 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-19 13:58:15 +00:00
ntfreak 0cba0d4df3 - remove target specific variant and use target->variant member
- fix build warning in cortex_m3
- code cleanup - remove trailing lf and convert c++ comments

git-svn-id: svn://svn.berlios.de/openocd/trunk@1238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-12-13 12:44:39 +00:00
oharboe edfca66467 now compiles under Cygwin and eCos again.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1102 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-27 07:32:09 +00:00
ntfreak 88c940c4b8 - fix native mingw build if gettimeofday not defined.
- reformat whitespace in startup.tcl

git-svn-id: svn://svn.berlios.de/openocd/trunk@1101 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-24 15:53:22 +00:00
oharboe 6eeab625cd fix warnings when building for eCos
git-svn-id: svn://svn.berlios.de/openocd/trunk@1085 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-22 07:37:40 +00:00
oharboe eaea7552ac try to get struct timezone def right w.r.t. config.h. Now compiles under Cygwin and eCos
git-svn-id: svn://svn.berlios.de/openocd/trunk@1080 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-10-17 12:55:27 +00:00
ntfreak 68c598e88d - added myself to copyright on files i remember adding large contributions for over the years
- cleaned up headers to match rest of code
- added missing svn props for previously added files

git-svn-id: svn://svn.berlios.de/openocd/trunk@987 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-09-20 10:50:53 +00:00
oharboe 526fe3d83e added yours sincerely for files where I feel that I've made non-trivial contributions.
git-svn-id: svn://svn.berlios.de/openocd/trunk@872 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-25 06:54:17 +00:00
ntfreak 655e4f88a6 - fixed build issues with win32
- fixed build warnings for last commit
- set svn props for last commit

git-svn-id: svn://svn.berlios.de/openocd/trunk@760 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-07-06 23:22:17 +00:00
oharboe 2585fc3420 Don Porges fixed c99 issues.
git-svn-id: svn://svn.berlios.de/openocd/trunk@553 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-04-09 05:55:23 +00:00
ntfreak d47e1b8f36 - rename log functions to stop conflicts under win32 (wingdi)
git-svn-id: svn://svn.berlios.de/openocd/trunk@523 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-25 15:45:17 +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
oharboe 2c5fc392f0 Uwe Hermann tightned up comments, etc. to follow OpenOCD policy
git-svn-id: svn://svn.berlios.de/openocd/trunk@431 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-03-02 08:39:02 +00:00
drath 3d6bcf0792 - convert all files to unix line-ending
git-svn-id: svn://svn.berlios.de/openocd/trunk@347 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2008-02-25 17:48:04 +00:00
mifi 7ff3a0d12e Corrected typo (to many brackets)
git-svn-id: svn://svn.berlios.de/openocd/trunk@230 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-14 19:54:18 +00:00
mifi a877c4b9f0 Sorry, I have forgotten to add a description for the last version, where
I have added the clear_malloc and fill_malloc functionality. But the default
is the original malloc.



git-svn-id: svn://svn.berlios.de/openocd/trunk@229 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2007-12-14 19:15:32 +00:00