target/stm32h7x: add support of dual core variant of STM32H7
[fw/openocd] / src / rtos / uCOS-III.c
index 0a0fb3e9e7e785f56cebe6dfe6ebbead2dd3b33d..304d07c59117693d5a5f7af4a448b73b6fdfdb4c 100644 (file)
@@ -68,6 +68,20 @@ static const struct uCOS_III_params uCOS_III_params_list[] = {
                &rtos_uCOS_III_Cortex_M_stacking,       /* stacking_info */
                0,                                                                      /* num_threads */
        },
+       {
+               "esirisc",                                                      /* target_name */
+               sizeof(uint32_t),                                       /* pointer_width */
+               0,                                                                      /* thread_stack_offset */
+               0,                                                                      /* thread_name_offset */
+               0,                                                                      /* thread_state_offset */
+               0,                                                                      /* thread_priority_offset */
+               0,                                                                      /* thread_prev_offset */
+               0,                                                                      /* thread_next_offset */
+               false,                                                          /* thread_offsets_updated */
+               1,                                                                      /* threadid_start */
+               &rtos_uCOS_III_eSi_RISC_stacking,       /* stacking_info */
+               0,                                                                      /* num_threads */
+       },
 };
 
 static const char * const uCOS_III_symbol_list[] = {
@@ -241,7 +255,7 @@ static int uCOS_III_update_thread_offsets(struct rtos *rtos)
        return ERROR_OK;
 }
 
-static int uCOS_III_detect_rtos(struct target *target)
+static bool uCOS_III_detect_rtos(struct target *target)
 {
        return target->rtos->symbols != NULL &&
                        target->rtos->symbols[uCOS_III_VAL_OSRunning].address != 0;
@@ -286,6 +300,11 @@ static int uCOS_III_update_threads(struct rtos *rtos)
        struct uCOS_III_params *params = rtos->rtos_specific_params;
        int retval;
 
+       if (rtos->symbols == NULL) {
+               LOG_ERROR("uCOS-III: symbol list not loaded");
+               return ERROR_FAIL;
+       }
+
        /* free previous thread details */
        rtos_free_threadlist(rtos);
 
@@ -454,7 +473,8 @@ static int uCOS_III_update_threads(struct rtos *rtos)
        return ERROR_OK;
 }
 
-static int uCOS_III_get_thread_reg_list(struct rtos *rtos, threadid_t threadid, char **hex_reg_list)
+static int uCOS_III_get_thread_reg_list(struct rtos *rtos, threadid_t threadid,
+               struct rtos_reg **reg_list, int *num_regs)
 {
        struct uCOS_III_params *params = rtos->rtos_specific_params;
        int retval;
@@ -484,7 +504,8 @@ static int uCOS_III_get_thread_reg_list(struct rtos *rtos, threadid_t threadid,
        return rtos_generic_stack_read(rtos->target,
                        params->stacking_info,
                        stack_address,
-                       hex_reg_list);
+                       reg_list,
+                       num_regs);
 }
 
 static int uCOS_III_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])