diff options
author | Chao Du <duchao@eswincomputing.com> | 2023-02-17 07:43:13 +0000 |
---|---|---|
committer | Chao Du <duchao@eswincomputing.com> | 2023-02-17 07:45:05 +0000 |
commit | 1655620c0cbd4f6fabf04df087f277eb106500f8 (patch) | |
tree | 513be92f20573e9c804a4c7e949bfd4ebff95f56 /src | |
parent | 87f9e590b9d93d1be8f315ef1ab008b94a4e2098 (diff) | |
download | riscv-openocd-1655620c0cbd4f6fabf04df087f277eb106500f8.zip riscv-openocd-1655620c0cbd4f6fabf04df087f277eb106500f8.tar.gz riscv-openocd-1655620c0cbd4f6fabf04df087f277eb106500f8.tar.bz2 |
Set the current_thread when no FreeRTOS task was created.
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/rtos/FreeRTOS.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c index 96b535d..e017c57 100644 --- a/src/rtos/FreeRTOS.c +++ b/src/rtos/FreeRTOS.c @@ -501,6 +501,7 @@ static int freertos_update_threads(struct rtos *rtos) LOG_ERROR("Error allocating memory for %" PRIu64 " threads", thread_list_size); return ERROR_FAIL; } + rtos->current_thread = 1; rtos->thread_details->threadid = 1; rtos->thread_details->exists = true; rtos->thread_details->extra_info_str = NULL; |