summaryrefslogtreecommitdiff
path: root/src/helper
Commit message (Collapse)AuthorAgeFilesLines
* performance: committed wrong version of buf_set_buf optimizationMathias K2011-02-081-4/+18
| | | | | | oops... Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* buf_set_buf around 30% speed increaseMathias K2011-02-081-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Also i have checked the input of this function and in many cases a simple byte copy is possible. I have added this check now and is it possible the buffer is copied byte by byte and not bit by bit. With byte boundary input the test looks like this: buf_set_buf 0x02000000 iteration test: runtime (seconds): old: 6.828559 new: 0.436191 diff: 6.392368 runtime (seconds): old: 6.853636 new: 0.430389 diff: 6.423247 runtime (seconds): old: 6.794985 new: 0.423065 diff: 6.371920 Without: buf_set_buf 0x02000000 iteration test: runtime (seconds): old: 6.370869 new: 5.552624 diff: 0.818245 runtime (seconds): old: 6.420730 new: 5.665887 diff: 0.754843 runtime (seconds): old: 6.583306 new: 5.599021 diff: 0.984285 Regards, Mathias
* 24bit buffer supportMathias K2011-02-031-0/+24
| | | | | | | | | | Hello, this patch add 24bit support to the target buffer functions and little/big endian functions. Regards, Mathias
* error: remove debug output when reporting errorsØyvind Harboe2011-01-311-1/+2
| | | | | | The user does not need to know or care about "command handlers". Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* nit: more LOG_* \n fixesEric Wetzel2011-01-092-7/+3
| | | | | | | | | Remove extra \n from LOG_DEBUG, LOG_INFO, and LOG_WARNING messages Remove LOG_INFO_N LOG_INFO_N was only used once and had a \n at the end Change LOG_USER_N calls that end with \n to LOG_USER
* nit: do not add \n at end of LOG_ERROREric Wetzel2011-01-051-6/+6
| | | | Fixed in many other places, and submitted in response to Øyvind's invitation.
* error handling: the error number is not part of the user interfaceØyvind Harboe2011-01-031-2/+2
| | | | | | | | Do not propagate error number to user. This is for internal programming purposes only. Error messages to the user is reported as text via LOG_ERROR(). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* Compilation Warnings on OS X 10.5Andrew MacIsaac2010-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I received a number of "-Wshadow" related warnings (treated as errors) while trying to build on OS X Leopard. In addition, there were two miscellaneous other warnings in the flash drivers. Attached are two patches which correct these issues and the commit messages to accompany them. My system has the following configuration (taken from uname -a): Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386 === Werror_patch.txt Commit Message === compilation: fixes for -Wshadow warnings on OS X These changes fix -Wshadow compilation warnings on OS X 10.5.8 Compiled with the following configure command: ../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink --enable-ft2232_libftdi === flash_patch.txt Commit Message === compilation: fixes for flash driver warnings on OS X These changes fix two compilation warnings on OS X 10.5.8: ../../../../src/flash/nor/at91sam3.c:2767: warning: redundant redeclaration of 'at91sam3_flash' ../../../../src/flash/nor/at91sam3.c:101: warning: previous declaration of 'at91sam3_flash' was here and ../../../../src/flash/nor/stmsmi.c:205: warning: format not a string literal and no format arguments Compiled with the following configure command: ../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink --enable-ft2232_libftdi === Andrew
* warnings: use more 'const' for char *Øyvind Harboe2010-12-293-3/+3
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* script: support only Tcl commentsØyvind Harboe2010-12-181-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only Tcl comments are now supported. For classic style commands comments were supported at the end of the line. Move in the direction of letting the script language decide syntax, rather than have special rules for some commands. Before this patch goes in, the scripts should be updated to use ;# instead of # for end of line comments. > mdw 0 1 2 mdw ['phys'] address [count] zy1000.cpu mdw address [count] Command handler execution failed in procedure 'mdw' > mdw 0 1 #2 mdw ['phys'] address [count] zy1000.cpu mdw address [count] Command handler execution failed in procedure 'mdw' > mdw 0 1 ;#2 0x00000000: ffffffff > mdw 0 1 0x00000000: ffffffff > mdw 0 0x00000000: ffffffff Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* build: add common.mkSpencer Oliver2010-11-181-4/+1
| | | | | | | Rather than specifying common makefile variables move them all to a common.mk. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* JIM: document "echo" commandAntonio Borneo2010-11-091-9/+14
| | | | | | | | | Document "-n" option in manual; Modify "echo" command definition as COMMAND_HANDLER to easily add help message Add help message aligned with manual. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* JIM: Add "-n" option to "echo"Antonio Borneo2010-11-091-1/+8
| | | | | | | | With the new JIMTCL, "puts" only writes to stdout. To write on telnet port too, "echo" must be used. This patch gives to "echo" similar commandline option of "puts". Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* jim tests: use installedØyvind Harboe2010-10-297-14857/+9
| | | | Delete obsolete jim that comes with OpenOCD.
* help: help now works on configuration commandsØyvind Harboe2010-10-271-3/+0
| | | | | | | | | help would not show help for commands when the command interpreter was in the wrong mode, which means that e.g. "help newtap" didn't work, it wouldn't show the "jtag newtap" help as it was a configuration command. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* gdbderver: fix gdb pipe startup overflowSpencer Oliver2010-10-051-3/+5
| | | | | | | | When usng gdb pipes we need to keep openocd output at a minimum, otherwise the gdb stdin will overflow and fail. Make the calls to gdb_port and log_output synchronous to stop this. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
* server: add support for pipesØyvind Harboe2010-10-011-9/+4
| | | | | | | -p/--pipe is now deprecated. Use '-c "gdb_port pipe;log_output openocd.log"' instead. Warning logged. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* log: remove hack to redirect logs when pipes are in useØyvind Harboe2010-10-011-17/+2
| | | | | | | | | | | There is an explicit command "log_output" that can be used to redirect log output to a file, no need for a hack in the first place. Before enabling pipes, use "log_output foo" to redirect log output to the "foo" files. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fileio: fileio_size() can now failØyvind Harboe2010-09-292-3/+13
| | | | | | Part of making the fileio API more robust. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fileio: refactor struct fileio to be an opaque structureØyvind Harboe2010-09-292-22/+47
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* startup: removed capture_catchØyvind Harboe2010-09-201-7/+0
| | | | | | not used. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* helper: fix flaky capture commandØyvind Harboe2010-09-201-0/+16
| | | | | | | | | | | capture of progress output would get polling results. This will break in the example below where polling output would override the tcl return value. capture {sleep 10000; set abc def} Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* warnings: fix alignment warningsØyvind Harboe2010-09-201-1/+1
| | | | | | | These warnings are for architectures that do not support non-aligned word access. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jim: fix crash when using Jim_ListInsertElementsØyvind Harboe2010-09-121-0/+1
| | | | | | | Jim_ListInsertElements was simply forgotten from the fn that registered all the APIs. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* command: capture command now handles both types commandsØyvind Harboe2010-09-111-2/+24
| | | | | | | | | | | | | | | | | | | | | | Commands that output progress output and no return value will have the progress output captured. Commands that do not output progress output(tcl commands) will return the tcl return value instead. The advantage here is that it is no longer necessary to consider which command one is capturing, it works for either. Example #1: capture progress output: set foo [capture help] Example #2: capture tcl return value set foo [capture {set abc def}] Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ioutil: fix internal fn namesØyvind Harboe2010-08-021-15/+11
| | | | | | prefix w/ioutil_ Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* util: ms command to calculate length of operationsØyvind Harboe2010-08-013-1/+92
| | | | | | | This can be used to calculate approximate RTCK frequency for instance. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* helper/jim-eventloop.h: review unused definitionsAntonio Borneo2010-06-211-14/+1
| | | | | | Remove unused typedef and define Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* helper/jim-eventloop: review unused symbolsAntonio Borneo2010-06-211-10/+0
| | | | | | | | Remove unused functions: - Jim_CreateSignalHandler - Jim_DeleteSignalHandler Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* helper/jim-eventloop: review scope of symbolsAntonio Borneo2010-06-212-22/+9
| | | | | | | | Add "static" qualifier to private functions. Remove private prototypes from include file. Remove empty definition of JIM_STATIC. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* reverse order of Jim stack trace outputAndreas Fritiofson2010-06-181-1/+1
| | | | | | The stack traces makes much more sense this way. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
* don't add confusing source info to JimAndreas Fritiofson2010-06-181-2/+2
| | | | | | | | | | | | | When an interactive command fails, the Jim stack trace prints references to the line in "command.c" where the interpreter was invoked. Since that location has no relation to the actual command that failed, the information serves only to add confusion. By not adding the useless source info to Jim the noise can be reduced, while still printing a useful trace for nested commands. Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* helper/jim: review unused symbolsAntonio Borneo2010-06-181-24/+0
| | | | | | | | | | Remove unused functions: - Jim_IdentityHashFunction - StringAppendObj - JimReferencesHTDoubleHashFunction Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* helper/jim: review scope of symbolsAntonio Borneo2010-06-181-39/+40
| | | | | | | | | | | | Add "static" qualifier to private functions. Function Jim_InterpolateTokens() is private, but has not been changed to "static". This function is called only once, so compiler inlines it. After inline, there is a warning for variable uninitialized. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* mingw32: -Wshadow fixesFreddie Chopin2010-06-171-9/+9
| | | | | | in jim.c (error: declaration of ‘boolean’ shadows a global declaration; /usr/local/lib/gcc/i686-w64-mingw32/4.4.2/../../../../i686-w64-mingw32/include/rpcndr.h:52: error: shadowed declaration is here) Signed-off-by: Freddie Chopin <freddie_chopin@op.pl>
* helper: remove helper membufAntonio Borneo2010-06-173-380/+1
| | | | | | Helper is now unused. Can be removed. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* oops... backup file snuck in, remove it.Øyvind Harboe2010-06-161-12823/+0
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* fileio: -Wshadow warning fixØyvind Harboe2010-06-151-2/+2
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jim: -Wshadow warning fixØyvind Harboe2010-06-152-3/+12826
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jim: more jim -Wshadow fixes that should be straightforwardØyvind Harboe2010-06-151-7/+6
| | | | | | | this bunch was a bit less obvious, but looked straightforward. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jim: -Wshadow fixesØyvind Harboe2010-06-151-88/+88
| | | | | | | | | this batch of fixes should be pretty straightforward rename of 'index' and an 'i' local variable shadowing. 'index' conflicts with a global name. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* -Wshadow fixesØyvind Harboe2010-06-141-8/+8
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* helper: fix -Wshadow warning in number parsingØyvind Harboe2010-06-141-6/+6
| | | | | | | use obtuse local variable names in macros to avoid interfering with global name space Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* jim: fix bug in tcl "puts"Øyvind Harboe2010-05-181-9/+4
| | | | | | | | | | | | tcl "puts" didn't work because the logging code sensored strings that did not include a '\n'. The correct thing is to sensor empty strings, which are used to keep gdb connection alive. The tcl "puts" code broke apart strings which do contain '\n' in order to implement the -nonewline argument, which is how it got hurt by the bug in log.c Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* command context: fix errors when running certain commands on startupØyvind Harboe2010-05-052-2/+10
| | | | | | | | | | | Various commands, e.g. "arm mcr xxxx" would fail if invoked upon startup since it there was no command context defined for the jim interpreter in that case. A Jim interpreter is now associated with a command context(telnet, gdb server's) or the default global command context. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* HELPER/LOG: review unused symbolsAntonio Borneo2010-04-102-46/+0
| | | | | | | | | Remove unused functions: - log_catch - log_rethrow - log_try Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* BINARYBUFFER: review scope of data and functionsAntonio Borneo2010-04-101-2/+2
| | | | | | Add "static" qualifier to private data and functions. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* TIME_SUPPORT: review unused symbolsAntonio Borneo2010-04-102-8/+0
| | | | | | | Remove unused functions: - timeval_add Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
* gpl: fix GPL startup messageØyvind Harboe2010-02-151-1/+1
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* CMD: duplicate cmd error msgSpencer Oliver2010-02-041-1/+4
| | | | | | | | | When registering cmds we report duplicate attempts to register a cmd as a LOG_ERROR. Some situations need this, such as when registering dual flash banks. http://www.mail-archive.com/openocd-development@lists.berlios.de/msg11152.html Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>