aboutsummaryrefslogtreecommitdiff
path: root/src/rtos
diff options
context:
space:
mode:
authorChao Du <124672769+Du-Chao@users.noreply.github.com>2023-06-15 02:39:21 +0800
committerGitHub <noreply@github.com>2023-06-14 11:39:21 -0700
commitc6e0716ac959715416767ed6e455a55af422fd38 (patch)
treed149e9101751d6b453cc909ff028d6394d6c635b /src/rtos
parent8f81655256b44a7bcebe28f45dc74e60f974a9af (diff)
downloadriscv-openocd-c6e0716ac959715416767ed6e455a55af422fd38.zip
riscv-openocd-c6e0716ac959715416767ed6e455a55af422fd38.tar.gz
riscv-openocd-c6e0716ac959715416767ed6e455a55af422fd38.tar.bz2
rtos/FreeRTOS: pxCurrentTCB should be used for judgment. (#862)
* 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>
Diffstat (limited to 'src/rtos')
-rw-r--r--src/rtos/FreeRTOS.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c
index 7b296cc..de9f07f 100644
--- a/src/rtos/FreeRTOS.c
+++ b/src/rtos/FreeRTOS.c
@@ -496,19 +496,19 @@ static int freertos_update_threads(struct rtos *rtos)
rtos_free_threadlist(rtos);
/* read the current thread */
- target_addr_t pxCurrentTCB;
+ target_addr_t px_current_tcb;
retval = freertos_read_struct_value(rtos->target,
rtos->symbols[FREERTOS_VAL_PX_CURRENT_TCB].address,
0,
freertos->pointer_size,
- &pxCurrentTCB);
+ &px_current_tcb);
if (retval != ERROR_OK) {
LOG_ERROR("Error reading current thread in FreeRTOS thread list");
return retval;
}
LOG_DEBUG("FreeRTOS: Read pxCurrentTCB at 0x%" PRIx64 ", value 0x%" PRIx64,
rtos->symbols[FREERTOS_VAL_PX_CURRENT_TCB].address,
- pxCurrentTCB);
+ px_current_tcb);
/* read scheduler running */
uint32_t scheduler_running;
@@ -523,7 +523,7 @@ static int freertos_update_threads(struct rtos *rtos)
rtos->symbols[FREERTOS_VAL_X_SCHEDULER_RUNNING].address,
scheduler_running);
- if ((thread_list_size == 0) || (rtos->current_thread == 0) || (scheduler_running != 1)) {
+ if (thread_list_size == 0 || px_current_tcb == 0 || scheduler_running != 1) {
/* Either : No RTOS threads - there is always at least the current execution though */
/* OR : No current thread - all threads suspended - show the current execution
* of idling */
@@ -711,7 +711,7 @@ static int freertos_update_threads(struct rtos *rtos)
strcpy(rtos->thread_details[tasks_found].thread_name_str, tmp_str);
rtos->thread_details[tasks_found].exists = true;
- if (value->tcb == pxCurrentTCB) {
+ if (value->tcb == px_current_tcb) {
char running_str[] = "State: Running";
rtos->current_thread = value->threadid;
rtos->thread_details[tasks_found].extra_info_str = malloc(