aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
AgeCommit message (Collapse)Author
2015-11-03rtos/mqx: Fix uninitialized parts of symbol tabledaniel-k
Memory for the symbol table was allocated by malloc but not initialized other than with the symbol name. Therefore `address` and `optional` members were having arbitrary values leading to every symbol being optional most of the time which messes up RTOS auto-detection. Memory will now be zero-initialized as in other RTOS implementations. Change-Id: I6c6e31ec1ef7e043061adf8c695b2139620e005d Signed-off-by: Daniel Krebs <github@daniel-krebs.net> Reviewed-on: http://openocd.zylin.com/3017 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-10-30rtos: handle STKALIGN adjustments on cortex mAndrew Ruder
In the case that the STKALIGN bit is set on Cortex M processors, on entry to an exception - the processor can store an additional 4 bytes of padding before regular stacking to achieve 8-byte alignment on exception entry. In the case that this padding is present, the processor will set bit (1 << 9) in the stacked xPSR register. Use the new calculate_process_stack callback to take into account the xPSR register and use it on the standard Cortex_M3 stacking. Note: Change #2301 had some misinformation regarding the padding. On Cortex-M the padding is stored BEFORE stacking so xPSR is always available at a fixed offset. Tested on a Cortex-M0+ (Atmel SAMR21) board which has STKALIGN fixed to a '1' such that this alignment always occurs on non-aligned stacks. Behavior of xPSR verified via the (bad-sorry) assembly program below by setting a breakpoint on the SVC_Handler symbol. The first time SVC_Handler is triggered the stack was 0x20000ff8, the second time SVC_Handler is triggered the stack was 0x20000ffc. Note that in both cases the interrupt handler gets 0x20000fd8 for a stack pointer. GDB exerpt: Breakpoint 1, 0x000040b6 in Reset_Handler () (gdb) hbreak SVC_Handler Hardware assisted breakpoint 2 at 0x40f8 (gdb) cont Continuing. Breakpoint 2, 0x000040f8 in SVC_Handler () (gdb) print $msp $3 = (void *) 0x20000fd8 (gdb) x/9w $msp 0x20000fd8: 0x1 0x2 0x3 0x4 0x20000fe8: 0x88160082 0xa53 0x40ce 0x21000000 0x20000ff8: 0x0 (gdb) cont Continuing. Breakpoint 2, 0x000040f8 in SVC_Handler () (gdb) print $msp $4 = (void *) 0x20000fd8 (gdb) x/9w $msp 0x20000fd8: 0x1 0x2 0x3 0x4 0x20000fe8: 0x88160082 0xa53 0x40e8 0x21000200 0x20000ff8: 0x0 Assembly program: .cpu cortex-m0plus .fpu softvfp .thumb .syntax unified .section .vectors @ pvStack: .word 0x20001000 @ pfnReset_Handler: .word Reset_Handler + 1 @ pfnNMI_Handler: .word 0 @ pfnHardFault_Handler: .word 0 @ pfnReservedM12: .word 0 @ pfnReservedM11: .word 0 @ pfnReservedM10: .word 0 @ pfnReservedM9: .word 0 @ pfnReservedM8: .word 0 @ pfnReservedM7: .word 0 @ pfnReservedM6: .word 0 @ pfnSVC_Handler: .word SVC_Handler + 1 .section .text .global Reset_Handler Reset_Handler: cpsie i ldr r0, .stack_start ldr r2, .stack_last eors r1, r1 .loop_clear: str r1, [r0] adds r0, r0, #4 cmp r0, r2 bne .loop_clear subs r2, r2, #4 mov sp, r2 movs r0, #1 movs r1, #2 movs r2, #3 movs r3, #4 svc #0 ldr r0, .stack_start ldr r2, .stack_last eors r1, r1 .loop_clear2: str r1, [r0] adds r0, r0, #4 cmp r0, r2 bne .loop_clear2 mov sp, r2 movs r0, #1 movs r1, #2 movs r2, #3 movs r3, #4 svc #0 .loop: b .loop .align 4 .stack_start: .word 0x20000f00 .stack_last: .word 0x20000ffc @ first call - 0x2000fff8 -- should already be aligned @ second call - 0x2000fffc -- should hit the alignment code .global SVC_Handler SVC_Handler: bx lr Change-Id: Id0940e6bbd6a59adee1378c0e86fe86830f0c8fc Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com> Cc: Paul Fertser <fercerpav@gmail.com> Cc: Andreas Fritiofson <andreas.fritiofson@gmail.com> Cc: Evan Hunter <evanhunter920@gmail.com> Cc: Jon Burgess <jburgess777@gmail.com> Reviewed-on: http://openocd.zylin.com/3003 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2015-10-30rtos: turn stack alignment into a function pointerAndrew Ruder
Some targets (Cortex M) require more complicated calculations for turning the stored stack pointer back into a process stack pointer. For example, the Cortex M stores a bit in the auto-stacked xPSR indicating that alignment had to be performed and an additional 4 byte padding is present before the exception stacking. This change only sets up the framework for Cortex-M unstacking and does not add Cortex-M support. Note: this also fixes the alignment calculation nearly addressed by change #2301 entitled rtos/rtos.c: fix stack alignment calculation. Updated calculation is in rtos_generic_stack_align. Change-Id: I0f662cad0df81cbe5866219ad0fef980dcb3e44f Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com> Cc: Paul Fertser <fercerpav@gmail.com> Cc: Andreas Fritiofson <andreas.fritiofson@gmail.com> Cc: Evan Hunter <evanhunter920@gmail.com> Cc: Jon Burgess <jburgess777@gmail.com> Reviewed-on: http://openocd.zylin.com/3002 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins
2015-08-06RTOS: ThreadX support on ARM926E-JSAlexander Drozdov
ThreadX uses two stacking schemas on ARM926E-JS, extend API to use more then one stecking at time. Change-Id: I92d445ad0981b6409ea4c4e7e438d3a7ae39cbe7 Signed-off-by: Alexander Drozdov <adrozdoff@gmail.com> Reviewed-on: http://openocd.zylin.com/2848 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-04-24rtos/mqx: prevent crash with -rtos autoPaul Fertser
Since mqx comes last in the list, with the auto option its update_threads is called even though it wasn't detected. This check should be removed from all the rtos helpers and moved to the generic code, but better do it later all in one go. Change-Id: If24ab42a58a468d90e9f12028d4c2fb76a9bc2e8 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2741 Tested-by: jenkins
2015-04-24rtos: fix print format specifiersPaul Fertser
Exposed by arm-none-eabi build. Change-Id: I657c642249aa83403f93132d1e28713aee692c30 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2724 Tested-by: jenkins
2015-04-16rtos: add instructions and helper code to make FreeRTOS work againAndreas Fritiofson
Run-time tested with FreeRTOS V8.1.2 (current version). For the time being I propose this way of dealing with RTOSes that do not export necessary information on their own. I also suggest implementing a similar scheme for ChibiOS, exporting the necessary struct fields' offsets via an OpenOCD-specific helper. Change-Id: Iacf8b88004d62206215fe80011fd7592438446a3 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2347 Tested-by: jenkins
2015-04-16FreeRTOS: Make optional symbols optionalAndreas Fritiofson
xSuspendedTaskList and xTasksWaitingTermination are only available for some configurations. Missing optional symbols will have their addresses remaining at zero so the corresponding lists will be skipped when building the task list. Change-Id: If330f5038d009298c3a14a4d2756db7105a30bc8 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2425 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-14ChibiOS: fix crash on auto detectionRichard Braun
The detection framework assumes rtos->symbols is dynamically allocated, an assumption that the ChibiOS variant breaks by providing a raw statically allocated symbol list. Change-Id: I379bcc2af99006912608ddd3f646ff7085606f47 Signed-off-by: Richard Braun <rbraun@sceen.net> Reviewed-on: http://openocd.zylin.com/2597 Tested-by: jenkins Reviewed-by: Stian Skjelstad <stian@nixia.no> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2015-04-14RTOS: Add logging to FreeRTOS and general RTOSEvan Hunter
Change-Id: I43d14f3b59daae7f90c344abdf71eaa8f74ef7ef Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/2391 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-03-09rtos: Freescale MQX rtos supportMarian Cingel
ARMv7E-M (CortexM4) architecture - fix position offset of r2,r3 registers on exception stack - switch 'calloc' arguments - remove prototypes of internal function and typedefs - add NULL check for alloc functions - remove last line of license "Franklin Street, Fifth Floor" because of 'checkpatch' validation - environment: jlink + twrk60n512 Change-Id: I70840ded15b17dd945ca190ce31e2775078da2d9 Signed-off-by: Marian Cingel <cingel.marian@gmail.com> Reviewed-on: http://openocd.zylin.com/2353 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-09ChibiOS: struct ChibiOS_params_list[] should not be constTomas Vanek
Procedure ChibiOS_update_memory_signature() sets struct member signature. Change-Id: I45adbd14fa7cda99413fd0b516d45b3fb55e322d Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/2427 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2015-01-09rtos: free gdb packet allocated memorySpencer Oliver
compile tested only. Change-Id: I3bc06c212967a3ce44a875f802b554c178537d1d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2382 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2014-11-24Added FPU support for ChibiOS/RTChristian Gudrian
When an enabled FPU is detected we now use an appropriate stacking. Change-Id: I1b0f43ec22e1c55c4f10e2ffa97d4aaa77bca5ee Signed-off-by: Christian Gudrian <christian.gudrian@gmx.de> Reviewed-on: http://openocd.zylin.com/2354 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-11-24rtos: add support for ChibiOS/RT 3.0Christian Gudrian
In ChibiOS/RT 3.0 the ready list pointer "rlist" is now part of the system data structure. Since the ready list is the first element in that structure it can be accessed via the structure's symbol "ch". Change-Id: Idc7eaa87cb7bbad0afa0ff1dafd54283bf429766 Signed-off-by: Christian Gudrian <christian.gudrian@gmx.de> Reviewed-on: http://openocd.zylin.com/2352 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-11-24rtos: allow symbols to be optional for a particular RTOSPaul Fertser
Default to non-optional. Change-Id: Ifc9ddb1ab701a19c3760f95da47da6f7d412ff2e Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/2355 Tested-by: jenkins Reviewed-by: Christian Gudrian <christian.gudrian@gmx.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-10-06rtos: constify symbol names and listsSpencer Oliver
Change-Id: I72f3cd50fc6a33a178e72e169c9660e707751524 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2292 Tested-by: jenkins
2014-03-30Don't cast return value of [cm]allocAndreas Fritiofson
Change-Id: I0028a5b6757b1ba00031893d9a2a1725f915a0d5 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/2069 Tested-by: jenkins Reviewed-by: Jörg Wunsch <openocd@uriah.heep.sax.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-29rtos: fix xml register support regressionSpencer Oliver
Seems that when xml register support was added the rtos code was not updated to match. This then caused gdb to return the following error when rtos support was enabled - "Remote 'g' packet reply is too long". Change-Id: I7429c4b1efed120e2e690678d55f3d6e87ee1ff1 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2054 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-03-04Constify received GDB packetChristian Eggers
v2: - Split work into separate patches The received packet will not be altered in any of the processing functions. Some it can be made "const". Change-Id: I7bb410224cf6daa74a6c494624176ccb9ae638ac Signed-off-by: Christian Eggers <ceggers@gmx.de> Reviewed-on: http://openocd.zylin.com/1919 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04gdb-server/rtos: Send correct answer to "qfThreadInfo" packetChristian Eggers
Even if no RTOS is configured, "qfThreadInfo" must be answered with "l" instead of "". Otherwise GDB will switch to the older thread packet ("qL"), which is not supported by OpenOCD. Change-Id: Iead045bdf8268bac2378c8f70829b17c37834e44 Signed-off-by: Christian Eggers <ceggers@gmx.de> Reviewed-on: http://openocd.zylin.com/1925 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-03-04RTOS: Unify wipe-out of thread listChristian Eggers
Each RTOS implementation uses it's own (similar) code to free the thread list. There are some additional issues: <---> if (pointer != NULL) free(pointer); <---> This is not necessary, free(NULL) is perfectly ok. <---> free(rtos->thread_details); rtos->thread_details = NULL; rtos->thread_count = 0; <---> The 3rd line has been missing for all RTOS but ChibiOs. There are paths in the code where rtos->thread_count is never set to NULL, which can lead to null pointer dereference of rtos->thread_details. Change-Id: I6f7045c3d4518b925cb80dd5c907a566536b34ad Signed-off-by: Christian Eggers <ceggers@gmx.de> --- Changelog: v7: - rtos_wipe_threadlist() --> rtos_free_threadlist() - removed non related changes in gdb_server.c from this patch v3: - Removed world "topic" from first line of commit message v2: - typo: "whipe" --> "wipe" Reviewed-on: http://openocd.zylin.com/1916 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-02-04rtos: fix uninitialised variable warningPaul Fertser
Breaks build with clang 3.3. This "addr" variable is actually always ignored by next_symbol() when cur_symbol is an empty string but clang can't (and probably shouldn't) prove that automatically. Change-Id: Id030f1aa34b9d40b5fa20a422031511520e52669 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/1876 Tested-by: jenkins Reviewed-by: Xiaofan <xiaofanc@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2014-01-15Conform to C99 integer types format specifiersHsiangkai Wang
Review and modify to conform to C99 integer types format specifiers. Use arm-none-eabi toolchain to build successfully. Change-Id: If855072a8f88886809309155ac6d031dcfcbc4b2 Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Signed-off-by: Hsiangkai <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1794 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-31Clean up const usage to avoid excessive castingAndreas Fritiofson
Don't use const on pointers that hold heap allocated data, because that means functions that free them must cast away the const. Do use const on pointer parameters or fields that needn't be modified. Remove pointer casts that are no longer needed after fixing the constness. Change-Id: I5d206f5019982fd1950bc6d6d07b6062dc24e886 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1668 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-10-10cortex_m: target implementation renames cortex_m3 to cortex_mSpencer Oliver
We changed the actual target name quite a while ago. This changes the actual target function names/defines to also match this change. Change-Id: I4f22fb107636db2279865b45350c9c776e608a75 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1626 Tested-by: jenkins
2013-09-13nds32: support FreeRTOSHsiangkai Wang
Change-Id: I117b5541fb19388c0f5c2344ee42d9151c9a222e Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1577 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-09-08rtos: Do not dereference null pointersSpencer Oliver
detected by clang. Change-Id: Id395f9d33bc2903b29a158fc3540ae51857e6aa0 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1555 Tested-by: jenkins
2013-08-07gdb_server: support gdb target descriptionHsiangkai Wang
* Add a parameter in .get_gdb_reg_list() to return different register lists as generating target description. * Modify STRUCT REG to let gdb generate target description according to register information. The modified structure of register is struct reg { const char *name; uint32_t number; /* for regnum="num" */ struct reg_feature *feature; /* for register group feature name */ bool caller_save; /* for save-restore="yes|no" */ void *value; bool dirty; bool valid; bool exist; uint32_t size; struct reg_data_type *reg_data_type; /* for type="type" */ const char *group; /* for group="general|float|vector" */ void *arch_info; const struct reg_arch_type *type; }; Change-Id: I2096b67adf94518ba0b8b23d8c6a9f64ad7932b8 Signed-off-by: Hsiangkai Wang <hsiangkai@gmail.com> Reviewed-on: http://openocd.zylin.com/1382 Tested-by: jenkins Reviewed-by: Franck Jullien <franck.jullien@gmail.com> Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-07-26rtos: issue warning on auto detect failureSpencer Oliver
Currently if we fail to auto detect an rtos then no warning is given. This can also be triggered if we only find some of the rtos symbols. Change-Id: I215991bbce0909bc6af93560b0f55db13defd123 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1514 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2013-07-01keep gdb aware of threads if RTOS is set but no threads are createdZied Guermazi
if gdb server (openocd) answers qfThreadInfo with an empty string during boot, gdb will not request thread info anymore. to keep thread awareness in gdb, we have to answer with a non empty string, 'l' indicates an end of list, and is a valid answer here. Change-Id: I7870a5db1090c786f306db16a25871e69b8a9760 Signed-off-by: Zied Guermazi <guermazi.zied@gmail.com> Reviewed-on: http://openocd.zylin.com/1432 Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-06-05update files to correct FSF addressSpencer Oliver
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-05-10Added: RTOS awareness for embKernelRavaz
Change-Id: I98b60f50a5fc486bda83b83ad7ec73826ee11607 Signed-off-by: Ravaz <embkernel@gmail.com> Reviewed-on: http://openocd.zylin.com/1334 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-04-28target: rename cortex_m3 to cortex_mSpencer Oliver
Rename cortex_m3 target to use a more correct cortex_m name. This also adds a deprecated_name var so that older scripts issue a warning to update the target name. cfg files have also been updated to the new target name. Change-Id: Ia8429f38e88da677249c5caa560c50f8ce56ea10 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1129 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-03-24rtos: fixed handling of qThreadExtraInfo packetsChristian Gudrian
The commit "gdbserver: use common hexify/unhexify routines" [3d62c3d] mis-replaced a call to "str_to_hex" with a call to "unhexify". "hexify" should have been used instead. Change-Id: I5f5904b1b422f819a6308e2c0740ea43d22c7d0b Signed-off-by: Christian Gudrian <christian.gudrian@gmx.de> Reviewed-on: http://openocd.zylin.com/1308 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2013-03-13target: Remove read_memory_impAndreas Fritiofson
Change-Id: Idc6ef3b075ccbb5945df8fea746011cb17175d8f Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/1219 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2013-03-12rtos: fixes warningØyvind Harboe
Change-Id: I45db15b16b52c71009d8830985f42ac88eabe160 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/1209 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2013-02-26gdbserver: use common hexify/unhexify routinesSpencer Oliver
Change-Id: I9989b625666e9c60ec9867cf6f4d94f41c998c3f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1105 Tested-by: jenkins Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2013-01-27rtos: fix error messageFreddie Chopin
Probably a copy&paste error or remainings of some older version. Change-Id: Ifb81a9a1fe8242f3b114cd0686dd264fbaad4920 Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com> Reviewed-on: http://openocd.zylin.com/1123 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2013-01-27rtos: do not use LOG_OUTPUTSpencer Oliver
LOG_OUTPUT is not intended for general output so use the correct LOG_* functions instead. Change-Id: I48d0fe765637024dbafc68f2ea08219d3ff42754 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1104 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2013-01-27rtos: Fix regression preventing use of first RTOS & clean up rtos_qsymbol()Evan Hunter
ThreadX support was not working due to it being first in the list of RTOS - regression. Auto-detect off, an RTOS was always be marked as successfully detected, even if symbols are not found. Lines 223-227 were unnecessary as they are done in rtos_try_next() Added lots of comments Improved readability by separating: GDB not finding a symbol vs no more symbols being available Regression caused by patch which was allowed only 52 minutes for review : http://openocd.zylin.com/895 Change-Id: Ib4decb01db595ddb3796837c6d8338ce6b9a91ca Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/986 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-12-23rtos: rename stm32_stlink target to hla_targetSpencer Oliver
Update rtos detection to use the new target name. Change-Id: I4e55311bcfbc8af55708b43daf0c73b1c8145934 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/923 Tested-by: jenkins
2012-12-14rtos: Add Cortex-R4 support for ThreadXEvan Hunter
Change-Id: I0b55af690ed917ca783d90d11dcf012f49792ed7 Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/994 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-11-12rtos: Fix error in reading the current thread in ChibiOS/RTMatthias Blaicher
Commit c4ab127b4069e20e introduces a copy&paste error which affects the detection of the current thread. As a result, the stack of the current thread won't be detected correctly in most cases. Change-Id: Ib46b8f64be8053d7e9103f427c66796963214419 Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/974 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-11-05rtos: Make ChibiOS code aware of endinessMatthias Blaicher
The ChibiOS code was derived from other RTOS support code which does not honor the target vs. host endiness. The other RTOS code still needs to be fixed. Change-Id: Idf42cfaa30945289bf1756ad6491fff84913eda9 Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/962 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-11-05rtos: Add FPU detection to ChibiOS/RTMatthias Blaicher
The stacking of ChibiOS/RT depends on the usage of an FPU. If the FPU is enabled the FPU registers are also saved on context switch. This patch adds automatic detection of FPU for armv7m targets. Note: With this patch, openocd will only output an error message warning that the FPU is enabled. For further FPU support, the correct stacking information also needs to be added. Change-Id: I0984cbd9180f247ba2fa610e74a6413cc54239ea Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/961 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-11-05rtos: Fix wrong ReadyList lookup in ChibiOSMatthias Blaicher
We already have the address of the ReadyList provided by gdb. It is wrong to resolve that address a second time and it only works by accident. Change-Id: I82fa2360931c416290cd7f83e1883f86f90dedc2 Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/959 Reviewed-by: Joel Bodenmann <joel@unormal.org> Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-28gdb: fix broken qCRC packet handlingSpencer Oliver
The rtos layer was incorrectly handling a qCRC packet as a qC packet. Make sure we check for the qCRC packet and return unhandled so the gdb server gets a chance to handle it. This packet is used in the gdb compare-sections cmd. Change-Id: I21f8e5fa7225fccd13d65cf9e40186895065a7e3 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/933 Tested-by: jenkins Reviewed-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-28gdb: use strncmp rather than strstrSpencer Oliver
All the packets received will be at start of the packet buffer, so use more efficient strncmp. Change-Id: Ib9c45d8f53425367006b1f880c1bde27f03a6cf9 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/932 Tested-by: jenkins Reviewed-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-28rtos: fix gdb qC command answerMatthias Blaicher
rtos->current_thread is of type int64_t. All other commands already respect this. Change-Id: I9951946ff2a09c53cd78c6ab882c80cdd2ab7ac6 Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/917 Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>