aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
AgeCommit message (Collapse)Author
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>
2012-10-28rtos: Use ARRAY_SIZE instead of coding it by handMatthias Blaicher
Use ARRAY_SIZE in helper/types.h to determine the size of the symbol list. Change-Id: Icc9838323510f8602efa5d0162a4daed33f863b9 Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/935 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-27rtos: Fix wrong allocation in linux_get_symbol_list_to_lookupMatthias Blaicher
linux_get_symbol_list_to_lookup allocates to few memory. On 64 bit systems the error did not show due to char* being twice its size, leaving accidentally enough space. This patch makes linux_get_symbol_list_to_lookup behave identical to all other RTOS. Change-Id: I290ea241fb20b65585c8be14609a92fdbd2a307d Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/934 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-16rtos: Add ChibiOS/RT supportMatthias Blaicher
This patch adds ChibiOS/RT support. This patch requires at least ChibiOS/RT development version starting from SVN revision 4734. Note, that the Thread structures depend not only on the target but also on the ChibiOS configuration at build time. To correct this ChibiOS includes a new "memory signature" which specifies the offsets. Special thanks go to Peter Stuge and Spencer Oliver for their continous input and feedback to this patch. Change-Id: I842bf7ba6c2309a4efe93d29ea6cd0784a8b22a3 Signed-off-by: Matthias Blaicher <matthias@blaicher.com> Reviewed-on: http://openocd.zylin.com/901 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2012-10-09rtos: Don't crash on qSymbol GDB packet when no RTOS is configuredMatthias Blaicher
Commit 43902905bbc8fdc9d764f3843d697161d9b5fd92 fixed a bug but also introduced a regression. The RTOS GDB packet handler is always called, not only when an RTOS is actually configured, so it is important to check if an RTOS has been configured or not before actually processing the qSymbol packet. Change-Id: I1aed54f6c2817e1ebf99ddcda051df4554ea5a3a Signed-off-by: Peter Stuge <peter@stuge.se> Reviewed-on: http://openocd.zylin.com/907 Tested-by: jenkins
2012-10-08rtos: support FreeRTOS over stlinkPaul Fertser
Since stlink is a special case it presents the same CPU core under a different name, so copy the configuration to account for that. Change-Id: I9febf79b388301bde6211d185b5b8161cdadb9ff Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/652 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-10-05rtos: Rewrite rtos_qsymbol() and fix auto-detect false positivePeter Stuge
Matthias Blaicher submitted a patch at http://openocd.zylin.com/#/c/891/ to fix the false positive; when no RTOS was detected OpenOCD used the last RTOS in the list. While reviewing the code affected by Matthias' patch a rewrite seemed appropriate, to make the code readable. Matthias has abandoned his change and this change also fixes the false positive. Change-Id: Ic3327ccd036da52ba0a7e21ef93018205e74149c Signed-off-by: Peter Stuge <peter@stuge.se> Reviewed-on: http://openocd.zylin.com/895 Reviewed-by: Matthias Blaicher <matthias@blaicher.com> Tested-by: jenkins
2012-10-05rtos: Rewrite rtos_try_next() for readabilityPeter Stuge
The new code is almost functionally equivalent to the old. The function now returns 0 instead of -1 if target->rtos has not yet been allocated. All call sites only test for success, and in practise that is also the only thing that matters; if the function successfully iterated to the next RTOS or not. Other than that the only difference is that the code is now readable. Many thanks to Matthias Blaicher for the fix to the iteration error! Change-Id: I3342826f653b5e46c99ad1f58eec26ff10795c33 Signed-off-by: Peter Stuge <peter@stuge.se> Reviewed-on: http://openocd.zylin.com/894 Reviewed-by: Matthias Blaicher <matthias@blaicher.com> Tested-by: jenkins
2012-10-05rtos: Rewrite rtos_create() for readabilityPeter Stuge
The new code is almost functionally equivalent to the old; besides error handling the only difference is that the code is now readable. Many thanks to Matthias Blaicher for pointing out an iteration error in the rtos_try_next() change, which also affected this change. Change-Id: If38b87439e9de2303b220b3a7e3200ceaa8391da Signed-off-by: Peter Stuge <peter@stuge.se> Reviewed-on: http://openocd.zylin.com/893 Tested-by: jenkins Reviewed-by: Matthias Blaicher <matthias@blaicher.com>
2012-08-24build: fix memory leaksSpencer Oliver
Fix the memory leaks found by clang-3.1 Change-Id: Iaae68627ef599c324c9c9ee5737c22e92512862d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/775 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-05-21build: add helper/types.h to config.hSpencer Oliver
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-04build: remove clang unused variable assignment warningsSpencer Oliver
Change-Id: Ibe5254704d6cd879a318a82c4f50d9da3c14276c Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/600 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-05-04build: remove clang unused variable increments warningsSpencer Oliver
Change-Id: Ib755474aa46f7233495fae1947bc27cd0b2d6b4f Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/599 Tested-by: jenkins Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
2012-03-19rtos: add sanity checking for FreeRTOS's quantity of prioritiesPaul Fertser
On operating systems with opportunistic malloc() (e.g. default setting in GNU/Linux) malloc can sometimes allocate a huge memory region but later the process will get killed on the first attempt to use this memory, so checking for malloc's return value is not enough to prevent a crash. This patch is compile-tested only. Change-Id: I5e21663115c8e9a0ca9f3d71f7ba4bd09e5c3bb1 Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/521 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-03-19rtos: fix segfault in FreeRTOS handlingPaul Fertser
When gdb loads an elf file of a newer or older version of the firmware being debugged, or when the firmware is not running yet, there's a high probability of FreeRTOS variables to be read incorrectly, thus leading to an attempt to allocate an enourmous amount of memory. Without this check OpenOCD simply crashes and that's mad confusing. Change-Id: I404a072e886d2d47d9d942cfaea8417eb8bd4a5d Signed-off-by: Paul Fertser <fercerpav@gmail.com> Reviewed-on: http://openocd.zylin.com/520 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2012-02-06build: cleanup src/rtos directorySpencer Oliver
Change-Id: I24bc62d12409dbfc20a0a986acf6b3f2c913e36d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/416 Tested-by: jenkins
2012-01-16build: fix broken make distcheckSpencer Oliver
0a4b27ec4bcb303547af68490f007d65a00bff02 commit forgot to update required distcheck files. Change-Id: I3a5b94d4548c02cb9c1fc371a6fdcc2a3854e9c7 Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/380 Tested-by: jenkins
2012-01-15rtos : linux awarenessMichel JAOUEN
Change-Id: I41294ccaa4a3cd253919c8b1b558205903bcb695 Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/348 Tested-by: jenkins Reviewed-by: Heythem Bouhaja <heythem.bouhaja-nonst@stericsson.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-15rtos : create qsymbol interface and add str_to_hex interfaceMichel JAOUEN
Change-Id: I1b26f7efd3ad4a060f772dd12408e77a03d93cea Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/347 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-15rtos : ps commandMichel JAOUEN
Change-Id: I1b00b6d72f425826c33b0df7dd63114ce642ce93 Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/345 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-15rtos : smp supportMichel JAOUEN
Change-Id: I583cddf5e62ed77f108786a085569ab8699ad50d Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/344 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-15rtos : current_threadid move to rtos contextMichel JAOUEN
Change-Id: I49d9d6d64c418be601d8723cb3eea9c3716ecb6b Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/343 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-15rtos :introduce possible overload by rtos of gdb_thread_packetMichel JAOUEN
Change-Id: I17381b581556fa75098a84699dbbf69423fe20eb Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/342 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2012-01-15rtos : remove unused parameterMichel JAOUEN
Change-Id: I98c9f28a0085bd4713b694181ab544777091eac6 Signed-off-by: Michel JAOUEN <michel.jaouen@stericsson.com> Reviewed-on: http://openocd.zylin.com/341 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-29Add stack alignment support to RTOS awareness - needed for ARM ABI processorsEvan Hunter
Change-Id: I69a2f3d0606a97d48b7738561a85da87f458b82b Signed-off-by: Evan Hunter <ehunter@broadcom.com> Reviewed-on: http://openocd.zylin.com/238 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-by: Mathias Küster <kesmtp@freenet.de> Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-11-07ecos: add missing error propagationØyvind Harboe
Change-Id: Ib34815c9cf654517f22486a7c8001fdb7471338c Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/174 Tested-by: jenkins Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
2011-11-05warning fix: add self-consitency check to remove warningØyvind Harboe
verify promise of code that more code can be pasted with an assert at the end condition of the code passage that builds string. Change-Id: I76a4e5f91b9142fff932e1493cb43c29eb6a0f80 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/143 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-27clang: fix warning about missing check for return valueØyvind Harboe
Change-Id: I0c6b6b8d1f0c30b6a503cb98df30584252bc0ee1 Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/129 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
2011-10-20rtos: remove broken code for handling the deprecated qP packetAndreas Fritiofson
Change-Id: Icca522c1e2a2877abb20665b171c61079b1d8f48 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/37 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
2011-10-20rtos: return the correct value if the T or H packets are handledAndreas Fritiofson
Change-Id: Iea31e20ee4e35c1a9cb7b93424c92b3f38081067 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: http://openocd.zylin.com/38 Tested-by: jenkins Reviewed-by: Evan Hunter <evan@ozhiker.com> Reviewed-by: Peter Stuge <peter@stuge.se>
2011-08-27Fix off by one bug in FreeRTOSEvan Hunter
2011-08-24remove target argument from gdb packet handling functionsJie Zhang
2011-08-24Add suspended task list to FreeRTOS supportEvan