From: OpenOCD-Gerrit <ope...@us...> - 2022-11-04 21:49:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 3ca7bc7354ea3f8db8384142c2bd8675789e7888 (commit) from 12ce170945917198b166a35160214d909dfb0dc0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3ca7bc7354ea3f8db8384142c2bd8675789e7888 Author: Ben McMorran <bem...@mi...> Date: Thu Oct 20 15:39:24 2022 -0700 ThreadX: set current_thread for kernel execution 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 <bem...@mi...> Change-Id: I7f71e730d047858898297e4cb31db8e47e0c371c Reviewed-on: https://review.openocd.org/c/openocd/+/7280 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/ThreadX.c b/src/rtos/ThreadX.c index 7b76fb625..5f90eb644 100644 --- a/src/rtos/ThreadX.c +++ b/src/rtos/ThreadX.c @@ -320,6 +320,12 @@ static int threadx_update_threads(struct rtos *rtos) rtos->thread_details->thread_name_str = malloc(sizeof(tmp_str)); strcpy(rtos->thread_details->thread_name_str, tmp_str); + /* 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. */ + rtos->current_thread = 1; + if (thread_list_size == 0) { rtos->thread_count = 1; return ERROR_OK; ----------------------------------------------------------------------- Summary of changes: src/rtos/ThreadX.c | 6 ++++++ 1 file changed, 6 insertions(+) hooks/post-receive -- Main OpenOCD repository |