aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/ThreadX.c
AgeCommit message (Collapse)AuthorFilesLines
2024-05-26openocd: drop include of target_type.hAntonio Borneo1-2/+1
Few files include target_type.h even if it is not needed. Drop the include. Other files access directly to target type's name instead of using the proper API target_type_name(). Use the API and drop the include. Change-Id: I86c0e0bbad51db93500c0efa27b7d6f1a67a02c2 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8260 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-11-15rtos/ThreadX: added check for NULL-named tasksGiulio Fieramosca1-9/+14
Thread name loading was not correctly handled if a ThreadX task has a NULL name. Signed-off-by: Giulio Fieramosca <giulio@glgprograms.it> Change-Id: I03071930182bc2585b61ce5d8c67491710883dd6 Reviewed-on: https://review.openocd.org/c/openocd/+/7328 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-11-04ThreadX: set current_thread for kernel executionBen McMorran1-0/+6
If we just invented thread 1 to represent the current execution, we need to make sure the RTOS object also claims it's the current thread so that threadx_get_thread_reg_list() doesn't attempt to read a thread control block at 0x00000001. Signed-off-by: Ben McMorran <bemcmorr@microsoft.com> Change-Id: I7f71e730d047858898297e4cb31db8e47e0c371c Reviewed-on: https://review.openocd.org/c/openocd/+/7280 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-09-18openocd: fix SPDX tag format for files .cAntonio Borneo1-1/+1
With the old checkpatch we cannot use the correct format for the SPDX tags in the file .c, in fact the C99 comments are not allowed and we had to use the block comment. With the new checkpatch, let's switch to the correct SPDX format. Change created automatically through the command: sed -i \ 's,^/\* *\(SPDX-License-Identifier: .*[^ ]\) *\*/$,// \1,' \ $(find src/ contrib/ -name \*.c) Change-Id: I6da16506baa7af718947562505dd49606d124171 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7153 Tested-by: jenkins
2022-07-23openocd: src/rtos: replace the GPL-2.0-or-later license tagAntonio Borneo1-13/+2
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: If0194089baded7f58dc5d87a35d6e0aff9f43785 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7070 Tested-by: jenkins
2022-02-14rtos: threadx: Add hla_target support for ThreadXBen McMorran1-0/+12
Tested with an AZ3166 dev board (which uses the STM32F412ZGT6) running the Azure RTOS ThreadX demonstration system. Signed-off-by: Ben McMorran <bemcmorr@microsoft.com> Change-Id: I44c8f7701d9f1aaa872274166321cd7d34fb1855 Reviewed-on: https://review.openocd.org/c/openocd/+/6829 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-11-05rtos: use struct member names instead of commentsTim Newsome1-10/+8
This is more readable, and as a bonus the compiler will help out if the definition of the struct changes. Change-Id: Ibf660134d9900173f6592407d5cc2203654a4a1b Signed-off-by: Tim Newsome <tim@sifive.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6659 Tested-by: jenkins Reviewed-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-07-24openocd: remove NULL comparisons with checkpatch [1/2]Antonio Borneo1-1/+1
Patch generated automatically through the new checkpatch with flags "--types COMPARISON_TO_NULL --fix-inplace". This only fixes the comparisons if (symbol == NULL) if (symbol != NULL) The case of NULL on the left side of the comparison is not tested. Some automatic fix is incorrect and has been massaged by hands: - if (*psig == NULL) + if (*!psig) changed as + if (!*psig) Change-Id: If4a1e2b4e547e223532e8e3d9da89bf9cb382ce6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6351 Tested-by: jenkins
2021-07-24openocd: fix simple cases of NULL comparisonAntonio Borneo1-12/+12
There are more than 1000 NULL comparisons to be aligned to the coding style. For recurrent NULL comparison it's preferable using trivial scripts in order to minimize the review effort. Patch generated automatically with the command: sed -i PATTERN $(find src/ -type f) where PATTERN is in the list: 's/(\([a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) == NULL)/(!\1)/g' 's/(\([a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(\([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\) != NULL)/(\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL == \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(!\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*->[a-z][a-z0-9_]*\))/(\1)/g' 's/(NULL != \([a-z][a-z0-9_]*\.[a-z][a-z0-9_]*\))/(\1)/g' Change-Id: Ida103e325d6d0600fb69c0b7a1557ee969db4417 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6350 Tested-by: jenkins
2021-07-02rtos: rename CamelCase symbolsAntonio Borneo1-47/+47
Only one exported symbol from eCos is included in this patch. The eCos code is left untouched to prevent conflicts with patches currently under review. While there, remove an unused camelcase macro Change-Id: I8d22dec6e243c00665d99a8b8ba00474b4f088db Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6305 Tested-by: jenkins Reviewed-by: Marc Schink <dev@zapb.de>
2021-07-02rtos: convert CamelCase enum in uppercaseAntonio Borneo1-8/+8
The eCos code is not part of this patch to prevent conflicts with patches currently under review. Change-Id: I71369165f2eef419b83a79ffcff50287f77949c6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6304 Tested-by: jenkins
2021-05-29rtos: use ARRAY_SIZE() and simplify rtos_type.create()Antonio Borneo1-16/+10
Use the existing macro ARRAY_SIZE(). Rewrite the functions rtos_type.create() to simplify the logic. Change-Id: I8833354767045d1642801d26944c9087a77add00 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6261 Tested-by: jenkins
2021-03-10rtos: Remove typedef'd structMarc Schink1-3/+3
The C style guide forbids typedef'd structs, see 'Naming Rules'. Change-Id: Ia7c8218fb61ff0c74b6dd0d10fb51a77cf059c14 Signed-off-by: Marc Schink <dev@zapb.de> Reviewed-on: http://openocd.zylin.com/6028 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2020-11-04rtos: declare local symbols as staticAntonio Borneo1-1/+1
Functions and variables that are not used outside the file should be declared as static. Change-Id: I9731a35496cd1c7421563c8961da5fa0e3cc71c3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5894 Tested-by: jenkins Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li>
2020-09-05openocd: use proper format with uint32_tAntonio Borneo1-1/+1
Modify the format strings to properly handle uint32_t data types. Change-Id: I4de49bf02c9e37b72240224c23fc83abe8a4fa83 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/5819 Tested-by: jenkins
2018-10-16rtos: support gdb_get_register_packetSteven Stallion1-41/+40
This patch adds support for p packet responses by targets configured with RTOS support. This change required moving to a rtos_reg struct, which is similar to struct reg used by targets, which resulted in needing to update each stacking with register numbers. This patch also allows targets with non-linear register numbers to function with RTOSes as well. Change-Id: I5b189d74110d6b6f2fa851a67ab0762ae6b1832f Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/4121 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
2017-12-06rtos: Use 'bool' as return type for detect_rtos()Marc Schink1-4/+4
Change-Id: I91ad0431d44ed94f48d20c4690f8642d66f52a9b Signed-off-by: Marc Schink <openocd-dev@marcschink.de> Reviewed-on: http://openocd.zylin.com/4274 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
2016-12-08gdb_server: support qXfer:threads:read packetSteven Stallion1-2/+2
This patch adds support for the qXfer:threads:read packet. In addition to providing a more efficient method of updating thread state, recent versions of GDB (7.11.1 and up) can also report remote thread names. While thread names are not enabled in this patch due to its limited applicability at the moment, it can be enabled at a later date with little effort. As a part of revamping how threads are presented to GDB, extra info strings for each of the supported RTOSes were updated to match conventions present in the GDB source code. For more information, see remote_threads_extra_info() in remote.c. This results in a much smoother experience when interacting with GDB. It is also worth mentioning that use of qXfer:threads:read works around a number of regressions in older versions of GDB regarding remote thread display. Trust me, it's great. Change-Id: I97dd6a93c342ceb9b9d0023b6359db0e5604c6e6 Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/3559 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-08-14rtos: remove display_str memberSteven Stallion1-5/+0
This patch removes the display_str member in the thread_detail struct. This member was not being used and provides no additional benefit over the thread_name_str and extra_info_str members. This change is made in preparation of support for the qXfer:threads:read packet, which will modernize how thread information is shared with GDB. Change-Id: I1f8bc6325e6aa790e02ea6caee9d6f44c5fedf36 Signed-off-by: Steven Stallion <stallion@squareup.com> Reviewed-on: http://openocd.zylin.com/3558 Tested-by: jenkins Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2016-05-24Remove FSF address from GPL noticesMarc Schink1-3/+1
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>
2015-10-30rtos: turn stack alignment into a function pointerAndrew Ruder1-2/+2
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 Drozdov1-2/+160
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>
2014-11-24rtos: allow symbols to be optional for a particular RTOSPaul Fertser1-2/+2
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 Oliver1-7/+6
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 Fritiofson1-8/+8
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-04RTOS: Unify wipe-out of thread listChristian Eggers1-19/+1
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>
2013-06-05update files to correct FSF addressSpencer Oliver1-1/+1
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-04-28target: rename cortex_m3 to cortex_mSpencer Oliver1-1/+1
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-01-27rtos: do not use LOG_OUTPUTSpencer Oliver1-15/+15
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>
2012-12-14rtos: Add Cortex-R4 support for ThreadXEvan Hunter1-1/+10
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-10-28rtos: Use ARRAY_SIZE instead of coding it by handMatthias Blaicher1-4/+3
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-02-06build: cleanup src/rtos directorySpencer Oliver1-266/+207
Change-Id: I24bc62d12409dbfc20a0a986acf6b3f2c913e36d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/416 Tested-by: jenkins
2011-07-10Fix typo in command outputLuca Bruno1-1/+1
Fix a bunch of minor typo in user facing output. Signed-off-by: Luca Bruno <lucab@debian.org>
2011-04-19rtos : compilation error on amd64Michel Jaouen1-9/+9
2011-04-15RTOS Thread awareness support wipBroadcom Corporation (Evan Hunter)1-0/+536
- works on Cortex-M3 with ThreadX and FreeRTOS Compared to original patch a few nits were fixed: - remove stricmp usage - unsigned compare fix - printf formatting fixes - fixed a bug with overrunning a memory buffer allocated with malloc.