aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
AgeCommit message (Collapse)AuthorFilesLines
2024-08-20Merge up to ac63cd00d792331914db0b6edd3f427c30eec3fa from upstreamParshintsev Anatoly1-23/+30
- src/jtag/drivers/ftdi.c: ``` ++<<<<<<< HEAD + int i; + static const uint8_t zero; ++======= + uint8_t zero = 0; ++>>>>>>> ocd_upstream ``` Decided to choose the latter. - src/target/riscv/riscv-013.c: ``` ++<<<<<<< HEAD + int abs_chain_position; + /* The base address to access this DM on DMI */ + uint32_t base; ++======= + unsigned int abs_chain_position; + ++>>>>>>> ocd_upstream ``` Decided to choose the latter (abs_chain_position is unsigned now) - src/target/riscv/batch.c: ``` ++<<<<<<< HEAD ++======= + void dump_field(int idle, const struct scan_field *field) + { ... + } ++>>>>>>> ocd_upstream ``` dump_field function is not needed anymore Signed-off-by: Parshintsev Anatoly <anatoly.parshintsev@syntacore.com>
2024-07-13rtos/hwthread: derive threadid from SMP indexEvgeniy Naydanov1-23/+30
As defined in `target/target.h`, `coreid` is the index of the target on the TAP, so, if an SMP group includes targets from multiple TAPs, it can not be used as the base for `threadid`. Change-Id: Ied7cfa42197aaf4908ef6628c6436f28d4856ebe Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7957 Tested-by: jenkins Reviewed-by: Mark Zhuang <mark.zhuang@spacemit.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2024-05-30Merge up to 437dde701c13e707e5fd912ef6403e09052e4d9b from upstreamEvgeniy Naydanov13-33/+20
Conflict in src/rtos/FreeRTOS.c due to fbea7d5d38d0dcbdd71cb574da9bd12c78b568cf -- resolved by replacing `target->type->name` with a call to `target_type_name()`. Change-Id: I56702c6133894458903de7a4d764903004aa8b86
2024-05-26openocd: drop include of target_type.hAntonio Borneo13-33/+20
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>
2023-12-05Merge commit 'a9080087d82688043ca216d50926228d09631297' into from_upstreamTim Newsome1-0/+1
Change-Id: I83a33c1022f8d1a7670ded62f16ec999fc4ef525
2023-11-20Merge commit '18281b0c497694d91c5608be54583172838be75c' into from_upstreamTim Newsome1-0/+1
Change-Id: I05cd5ef9b04fa61a27321ae9b6a4fecabe3dee80
2023-10-27Merge commit '9f23a1d7c1e27c556ef9787b9d3f263f5c1ecf24' into from_upstreamTim Newsome5-54/+36
Conflicts: HACKING src/target/riscv/riscv-013.c Change-Id: I43ccb143cae8daa39212d66a8824ae3ad2af6fef
2023-10-27OpenOCD memory leak in `hwthread_update_threads()`Kirill Radkin1-0/+1
Update `os_free()` from `rtos/rtos.c:96` to fix memory leaks Change-Id: Id7b4c775291b735a0b4423151c2930afce6bf0bd Signed-off-by: Kirill Radkin <kirill.radkin@syntacore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7934 Reviewed-by: Tim Newsome <tim@sifive.com> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2023-10-23Merge commit 'e17fe4db0f256ee4fb97dcfd6b9f7f55c966b190' into from_upstreamTim Newsome4-21/+20
Conflicts: src/flash/nor/drivers.c src/target/riscv/riscv.c Change-Id: Ide3eded7e0d5b0b446bfd0873a32c00cc9f128bd
2023-10-16Merge commit '0384fe5d596f42388f8b84d42959d899f29388ab' into from_upstreamTim Newsome1-1/+1
Conflicts: .github/workflows/snapshot.yml src/rtos/FreeRTOS.c Change-Id: I4c9ff887b69140e0f61cb3f75a2f2c1a12071320
2023-10-10rtos: Refactor rtos_get_gdb_reg()Tim Newsome1-56/+58
Exit early if conditions aren't satisfied, instead of putting the core code inside an if(). Also return ERROR_FAIL if conditions are satisfied but no matching registers were found. Change-Id: I77aa63d9f707bc38d1a71899275ba603914b52c9 Signed-off-by: Tim Newsome <tim@sifive.com>
2023-09-27gdb_server,rtos: Differentiate rtos_get_gdb_reg failing and not implementedTim Newsome1-1/+1
If it fails, then pass that failure on. If it's simply not implemented, then we can fall through and try target_get_gdb_reg_list_noread(). This difference matters when the target representing the current hwthread is unavailable, but the target that is linked to the gdb connection is available. In that case we want the operation to return an error to gdb, instead of reading the register from the target that is available. Change-Id: I9c84ca556f818c5580e25ab349a34a226fcf0f43 Signed-off-by: Tim Newsome <tim@sifive.com>
2023-09-12Merge commit 'ee31f1578a333a75737bc5b183cd4ae98cdaf798' into from_upstreamTim Newsome27-341/+1124
Conflicts: Makefile.am jimtcl src/helper/Makefile.am src/rtos/rtos.c src/rtos/rtos.h src/rtos/rtos_standard_stackings.c Change-Id: I00c98d20089558744988184370a8cb7f95f03329
2023-08-29Merge commit 'dfbbfac4d72e247e8094a49c8573b2f49689b6d5' into from_upstreamTim Newsome4-57/+125
Change-Id: I6e7c0866291dd87946a4fd49d9bfe4cddefb3957
2023-08-26rtos/zephyr: arm: fetch arm exc return offsetBruno Mendes1-0/+1
Since zephyrproject-rtos/zephyr@c3eeae8, Zephyr OS exposes offset of mode_exc_return in the arch struct for ARM. Accounting for this allows for consistency and enables logic with further offsets that may be added after this. Signed-off-by: Bruno Mendes <bd_mendes@outlook.com> Change-Id: Id53ebd80c5d98a7d94eb6b00ad638ce51e719822 Reviewed-on: https://review.openocd.org/c/openocd/+/7851 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2023-07-06rtos/hwthread: Call rtos_free_threadlist() again.Tim Newsome1-0/+3
I think this was incorrectly removed in a merge. Change-Id: I49fce230f35ae7bd368d2ed780c6c1ffe5939fda
2023-06-22rtos/FreeRTOS: solve some conflicting usage of thread id. (#865)Chao Du1-11/+17
* rtos/FreeRTOS: solve some conflicting usage of thread id. 1. There are some RISCV-specific usage of thread_id, which has conflict with upstream. Some adaptions are made in this patch, to make sure OpenOCD is sending a clear thread list to gdb. 2. Use freertos_read_struct_value for xSchedulerRunning. Change-Id: I001a88a0c6d8eac98a389c0217b4897f28124840 Signed-off-by: Chao Du <duchao@eswincomputing.com> * fix typo. Change-Id: Id6546cc74de44bbee7e44b7cb29b769a2f35ec4a * correct the data type. Change-Id: I28c7e111e569d94ba5f6e1ae21745ddb34d4dd12 * changes as per the review comment. Change-Id: Ica4c705a8f2657700dc27e24790287ca802480fd * another macro replacement. Change-Id: Ia9330fed32d917cf87804051ba1b8d6ac42cfb7b --------- Signed-off-by: Chao Du <duchao@eswincomputing.com>
2023-06-14rtos/FreeRTOS: pxCurrentTCB should be used for judgment. (#862)Chao Du1-5/+5
* rtos/FreeRTOS: pxCurrentTCB should be used for judgment. The current TCB is stored in pxCurrentTCB, which is somehow RISC-V-specific, should not be overwritten from upstream (#816). * fix the code style check. Signed-off-by: Chao Du <duchao@eswincomputing.com> Change-Id: I9ffa8947f0cb9e93c7d96866882a5a1e8e69afad * revert some over-changes in last commit. Change-Id: Ie88bd75b59190503db11ee4538281bd13b554e50 Signed-off-by: Chao Du <duchao@eswincomputing.com> --------- Signed-off-by: Chao Du <duchao@eswincomputing.com>
2023-05-18rtos: uCOS-III: split struct ucos_iii_paramsAntonio Borneo1-47/+35
The static analyser 'sparse' complains about using sizeof() on a struct that has variable size: src/rtos/uCOS-III.c:267:32: warning: using sizeof on a flexible structure src/rtos/uCOS-III.c:269:41: warning: using sizeof on a flexible structure src/rtos/uCOS-III.c:275:66: warning: using sizeof on a flexible structure The struct ucos_iii_params contains either constants values for different target type and variable fields. The last field is an variable size array, always allocated to UCOS_III_MAX_THREADS items. It's not practical to fix this size because we would get too huge initialization in data segment. Split away from struct ucos_iii_params all the variable fields and put them in struct ucos_iii_private. Add in the new struct a pointer to the selected element of ucos_iii_params_list[] and fix the size of array threads[] to its maximum value; this would be allocated at run-time, avoiding impacts to data segment. Change-Id: I569011a257783d35a8795adbda06e942b4157f2a Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7678 Tested-by: jenkins
2023-05-18rtos: move prototype of rtos_thread_packet() in rtos.hAntonio Borneo4-7/+1
The function rtos_thread_packet() is used across rtos and declared locally as extern. Move the prototype of the function in common include rtos.h Change-Id: I50d311b583148a2de628de0997ef1afc9103a70e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7677 Tested-by: jenkins
2023-05-18rtos: move in rtos.h the rtos_type's declarationAntonio Borneo2-16/+15
The static analyser 'sparse' complains, while compiling a rtos' file, that the struct rtos_type is declared in the file as non static, but it is not exposed through an include file. The message is: warning: symbol 'XXX' was not declared. Should it be static? Move the list of rtos_type's declaration in rtos.h Change-Id: Ia96dff077407a6653b11920519c1724e4c1167a3 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7660 Tested-by: jenkins
2023-05-05rtos: with pointers, use NULL instead of 0Antonio Borneo1-4/+4
Don't compare pointers with 0, use NULL when needed. Don't assign pointer to 0, use NULL. Detected through 'sparse' tool. Change-Id: Ifa81ba961c0d490cc74880b4a46b620e6358f779 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7598 Tested-by: jenkins
2023-05-04Merge commit '228fe7300c7df7aa05ba2c0bc19edde6d0156401' into from_upstreamTim Newsome7-166/+992
Conflicts: doc/openocd.texi src/jtag/aice/aice_pipe.c src/jtag/aice/aice_usb.c src/rtos/FreeRTOS.c src/rtos/hwthread.c src/rtos/rtos_standard_stackings.c src/target/riscv/riscv.c Change-Id: I0c6228c499d60274325be895fbcd8007ed1699bc
2023-04-14rtos/linux.c: Fix Linux user space border checkpanciyan1-1/+1
Linux kernel and user space border is 0xc0000000 not 0xc000000 Signed-off-by: panciyan <panciyan@eswincomputing.com> Change-Id: I6b487cce62ac31737deca97d5f5f7bbc081280f4 Reviewed-on: https://review.openocd.org/c/openocd/+/7570 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-04-07rtos/FreeRTOS: some optimization of freertos_update_threads()Chao Du1-2/+1
1. update the rtos->thread_count in time, to make sure the allocated thread_name_str and extra_info_str could be freed by rtos_free_threadlist(). Otherwise the abnormal return may cause a memory leak. 2. remove a redundant assignment to threadid. Signed-off-by: Chao Du <duchao@eswincomputing.com> Change-Id: Ifabc59d501c925b3d6aec8b04b2856d2c31cc4e2 Reviewed-on: https://review.openocd.org/c/openocd/+/7549 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-25rtos/nuttx: add Espressif target support and refactoringErhan Kurubas4-278/+329
Almost written from the beginning in a modern OpenOCD way. - Endiannes support - Proper variable types - Align with the other rtos implementations Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I0868a22da2ed2ab664c82b17c171dc59ede78d10 Reviewed-on: https://review.openocd.org/c/openocd/+/7444 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-03-16Merge commit '1293ddd65713d6551775b67169387622ada477c1' into from_upstreamTim Newsome32-429/+174
This includes https://sourceforge.net/p/openocd/mailman/message/37710818/, which should fix #814. Conflicts: .travis.yml contrib/loaders/flash/stm32/stm32f1x.S contrib/loaders/flash/stm32/stm32f2x.S doc/openocd.texi src/rtos/FreeRTOS.c src/server/gdb_server.c src/target/riscv/riscv-013.c src/target/riscv/riscv.c src/target/riscv/riscv.h src/target/riscv/riscv_semihosting.c tcl/target/esp_common.cfg tcl/target/gd32vf103.cfg tools/scripts/checkpatch.pl Change-Id: I1986c13298ca0dafbe3aecaf1b0b35626525e4eb
2023-03-08Calculate the FreeRTOS type sizes and offsets more adaptively. (#806)Chao Du1-6/+47
* Calculate the FreeRTOS type sizes and offsets more adaptively. The definition of TickType_t varies between different targets. And it is also related to configUSE_16_BIT_TICKS option. Thus introduce a new command to make sure we are using a correct ticktype size. Change-Id: I9e38b331a9f07b96eb9a2c259e32377fca0106ad Signed-off-by: Chao Du <duchao@eswincomputing.com> * redundant semicolon. Change-Id: Ia21f0537e476099d8fe519ef78b3328d14123a38 * Update after review. Change-Id: I1825185ec9b0557d7e01f34a8f366661b3734aa7 * update doc Change-Id: I24b21c88b02ca3d76f1362f2545e86c068fc0ec6 --------- Signed-off-by: Chao Du <duchao@eswincomputing.com>
2023-02-17Set the current_thread when no FreeRTOS task was created.Chao Du1-0/+1
The 'current thread' was not set when no FreeRTOS task created. Which could lead a wrongly invoking of freertos_get_thread_reg_list. Change-Id: I0e0f8327080ef698d7ed4aae5ac2a630d532ddeb Signed-off-by: Chao Du <duchao@eswincomputing.com>
2023-02-08Improve a debug log in freertos_update_threads()duchao1-1/+1
To make the log more accurate and comprehensible. In case the offset is non-zero. Signed-off-by: Chao Du <duchao@eswincomputing.com>
2023-01-28rtos: remove config.h includes from stackings headersErhan Kurubas14-37/+13
And add its own header to the rtos_xxx_stackings.c Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I084130fde7ee8645129a7cf60bb7bf59448e2f39 Reviewed-on: https://review.openocd.org/c/openocd/+/7441 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28rtos: Fix constness of struct rtos_typeAndreas Fritiofson7-25/+25
Change-Id: Iaa89f2ff4036c23f944ffb4f37fe0c7afaf5069b Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6680 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28rtos: Support rt-kernelAndreas Fritiofson3-0/+387
Works for the proprietary rt-kernel from rt-labs. See: https://rt-labs.com/product/rt-kernel/ Change-Id: Id2c2e292c15fb17eab25e3d07db05014daa2a2b0 Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6668 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28rtos/nuttx: add stacking info for Espressif Xtensa chipsErhan Kurubas1-0/+358
ESP32, ESP32-S2 and ESP32-S3 stack register offsets added Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: Ic6215c1d0152853fd08f82cbd3c138c7d62dbc46 Reviewed-on: https://review.openocd.org/c/openocd/+/7443 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28rtos: add custom stack read functionErhan Kurubas2-1/+11
This is optional field for the targets which has to implement their custom stack read function. Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: Icbc9ed66a052fc2cc0ef67e3ec4d85ab0c2c1b94 Reviewed-on: https://review.openocd.org/c/openocd/+/7442 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28rtos/nuttx: add riscv stacking infoErhan Kurubas2-0/+47
Tested with Espressif ESP32-C3 MCU Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: Ia71ace4909f2dc93ddc07a2ec5524cf374f1937c Reviewed-on: https://review.openocd.org/c/openocd/+/7251 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-28rtos/nuttx: move stacking info to the new nuttx stackings fileErhan Kurubas4-57/+78
Other OSes have separate files to keep stack register offsets. Adding them for NuttX as well will provide a clearer way to expand. Signed-off-by: Erhan Kurubas <erhan.kurubas@espressif.com> Change-Id: I1428fefefa199a95431f2073c0279dd7028ad8da Reviewed-on: https://review.openocd.org/c/openocd/+/7250 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2023-01-15src/rtos/eCos : Support per-build configuration specific structure layoutsJames G. Smith2-90/+950
Extended feature. This is a large patch, but is self-contained to the eCos support and does not affect any other openocd functionality. It does NOT affect existing eCos RTOS plugin users where their applications do not provide the extended symbolic helper information. If the helper symbols are not available the rtos support code will behave as before. This "dynamic" functionality is *required* because eCos does NOT have a fixed/hardwired, known, layout for the thread descriptor structure. The per-application build eCos configuration can affect the shape of the thread descriptor structure (field presence, and hence offsets of subsequent fields) such that constant values cannot be used to consistently interpret all possible eCos application configurations. For historical reasons, there is not yet a consistent namespace for the helper symbols across eCos HALs hence the support is currently limited to specific architectures (Cortex-M and ARM/Cortex-A). No new Clang analyser warnings are raised by this changeset. Change-Id: Ib3a36877326eeb56595cbca55e21b9e59a59c98a Signed-off-by: James G. Smith <jsmith@rallysmith.co.uk> Reviewed-on: https://review.openocd.org/c/openocd/+/6275 Reviewed-by: Alex Schuilenburg <alex.schuilenburg@gmail.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
2023-01-15nds32: drop it, together with aice adapter driverAntonio Borneo3-62/+0
The target nds32 and its companion adapter aice have not received any real improvement since 2013. It has been hard to keep them aligned during the evolution of OpenOCD code, with no way for maintainers to really check if they are still working. No real documentation is present for them in OpenOCD. The nds32 code triggers ~50 errors/warnings with scan-build. The arch nds32 has been dropped from Linux kernel v5.18-rc1. For all the reasons above, this code has been deprecated with commit 2e5df83de7f2 ("nds32: deprecate it, together with aice adapter driver") and tagged to be dropped before v0.13.0. Let it r.i.p. in OpenOCD git history. While there, drop from checkpatch list the camelcase symbols that where only used in this code. Change-Id: Ide52a217f2228e9da2f1cc5036c48f3536f26952 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7382 Tested-by: jenkins
2022-12-03hwthread: Restore current_threadid in hwthread_update_threadsKoudai Iwahori1-0/+10
When OpenOCD receives a step-execution command from GDB and the target is configured as rtos=hwthread, OpenOCD reconstructs the thread-info. However, OpenOCD does not restore the thread id which is currently selected by GDB. Due to this issue, OpenOCD sends the information of wrong thread to GDB after the step execution. This commit fixes the above issue by adding a code to save/restore the thread id selected by GDB. Signed-off-by: Koudai Iwahori <koudai@google.com> Change-Id: I761a1141c04d48f1290e4f09baa7c7024f86f36a Reviewed-on: https://review.openocd.org/c/openocd/+/7358 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-12-03hwthread: Add register validity check in get_thread_reg_listKoudai Iwahori1-0/+9
When OpenOCD receives 'g' packet (read general registers) from GDB and target is configured as rtos=hwthread, hwthread_get_thread_reg_list is called. However, it does not check if the register valid or not. Due to this issue, OpenOCD returns invalid register values to GDB. This commit adds a validity check to hwthread_get_thread_reg_list. If the register is not valid, it tries to read the register from the target. Signed-off-by: Koudai Iwahori <koudai@google.com> Change-Id: Iad6424b62124271ec411b1dfc044b57dfc460280 Reviewed-on: https://review.openocd.org/c/openocd/+/7357 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-11-22rtos/hwthread: Hide unavailable targets from thread list.Tim Newsome1-2/+4
Change-Id: I53c6e2876d9bab70800a0f080e72a2abe0499120 Signed-off-by: Tim Newsome <tim@sifive.com>
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-11rtos: hwthread: fix clang error core.NullDereferenceAntonio Borneo1-4/+4
Clang spots a potential NULL pointer dereferencing that is instead an incorrect use of an array of pointers: src/rtos/hwthread.c:254:32: warning: Dereference of null pointer [core.NullDereference] (*rtos_reg_list)[j].number = (*reg_list)[i].number; ^~~~~~~~~~~~~~~~~~~~~ The error has not been spotted before because: - this function is not called for the first core of the SMP node, - for the other cores on Cortex-A it still returns valid register value for the first 12 ARM registers, then it diverges. Also Valgrind does not spot any issue at runtime. Address the array correctly. While there, use DIV_ROUND_UP() macro for the computation. Change-Id: Ib87e60e0edfd9671091f5dcfa9aedaf1aed800d1 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/7337 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-11-11Revert "Remove duplicate of a counter in hwthread_update_threads"Tomas Vanek1-3/+7
Commit 0cedf10f8fd6 ("Remove duplicate of a counter in hwthread_update_threads") introduced a code bug. In the second foreach_smp_target() loop, variable "threads_found" gets passed to routine hwthread_fill_thread(). By removing the counting of threads_found from the second loop, the incorrect thread counter value gets passed to hwthread_fill_thread(). Change-Id: Ie89e53ccd28bb72b6838ef2f12106a1fe8d00994 Suggested-by: Daniel Goehring <dgoehrin@os.amperecomputing.com> Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: https://review.openocd.org/c/openocd/+/7307 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2022-11-10Improve a couple of user/debug messages. (#763)Tim Newsome1-1/+1
* gdb_server: Improve info message. Add target name and state to "Not running when halt was requested" message. Change-Id: Ic84e9a884b57caa270cfee0ca6fa6a0dd8e5d2bd Signed-off-by: Tim Newsome <tim@sifive.com> * rtos/hwthread: Nicer debug message in hwthread_update_threads() Change-Id: Ia5931a772476a2ae186ed87cd70d7e4be2f196fb Signed-off-by: Tim Newsome <tim@sifive.com> Signed-off-by: Tim Newsome <tim@sifive.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-10-08Remove duplicate of a counter in hwthread_update_threadsEvgeniy Naydanov1-7/+3
There is no need to count number of examined threads twice. Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Change-Id: Id32ead853d1ddcd4e67062d6f795700feb20cb4b Reviewed-on: https://review.openocd.org/c/openocd/+/7223 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
2022-09-29Use LOG_TARGET_FOO() functions in more places. (#731)Tim Newsome1-4/+3
Change-Id: Id2266dbfb6209bf0676f28e7383a12705ce2a70e Signed-off-by: Tim Newsome <tim@sifive.com> Signed-off-by: Tim Newsome <tim@sifive.com>
2022-09-18openocd: fix SPDX tag format for files .cAntonio Borneo21-21/+21
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