rtos: convert CamelCase enum in uppercase
The eCos code is not part of this patch to prevent conflicts with patches currently under review. Change-Id: I71369165f2eef419b83a79ffcff50287f77949c6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6304 Tested-by: jenkins
This commit is contained in:
parent
11a621c752
commit
3ad52aa34f
|
@ -120,17 +120,17 @@ struct rtos_type FreeRTOS_rtos = {
|
|||
};
|
||||
|
||||
enum FreeRTOS_symbol_values {
|
||||
FreeRTOS_VAL_pxCurrentTCB = 0,
|
||||
FreeRTOS_VAL_pxReadyTasksLists = 1,
|
||||
FreeRTOS_VAL_xDelayedTaskList1 = 2,
|
||||
FreeRTOS_VAL_xDelayedTaskList2 = 3,
|
||||
FreeRTOS_VAL_pxDelayedTaskList = 4,
|
||||
FreeRTOS_VAL_pxOverflowDelayedTaskList = 5,
|
||||
FreeRTOS_VAL_xPendingReadyList = 6,
|
||||
FreeRTOS_VAL_xTasksWaitingTermination = 7,
|
||||
FreeRTOS_VAL_xSuspendedTaskList = 8,
|
||||
FreeRTOS_VAL_uxCurrentNumberOfTasks = 9,
|
||||
FreeRTOS_VAL_uxTopUsedPriority = 10,
|
||||
FREERTOS_VAL_PX_CURRENT_TCB = 0,
|
||||
FREERTOS_VAL_PX_READY_TASKS_LISTS = 1,
|
||||
FREERTOS_VAL_X_DELAYED_TASK_LIST1 = 2,
|
||||
FREERTOS_VAL_X_DELAYED_TASK_LIST2 = 3,
|
||||
FREERTOS_VAL_PX_DELAYED_TASK_LIST = 4,
|
||||
FREERTOS_VAL_PX_OVERFLOW_DELAYED_TASK_LIST = 5,
|
||||
FREERTOS_VAL_X_PENDING_READY_LIST = 6,
|
||||
FREERTOS_VAL_X_TASKS_WAITING_TERMINATION = 7,
|
||||
FREERTOS_VAL_X_SUSPENDED_TASK_LIST = 8,
|
||||
FREERTOS_VAL_UX_CURRENT_NUMBER_OF_TASKS = 9,
|
||||
FREERTOS_VAL_UX_TOP_USED_PRIORITY = 10,
|
||||
};
|
||||
|
||||
struct symbols {
|
||||
|
@ -174,17 +174,17 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
|
|||
return -3;
|
||||
}
|
||||
|
||||
if (rtos->symbols[FreeRTOS_VAL_uxCurrentNumberOfTasks].address == 0) {
|
||||
if (rtos->symbols[FREERTOS_VAL_UX_CURRENT_NUMBER_OF_TASKS].address == 0) {
|
||||
LOG_ERROR("Don't have the number of threads in FreeRTOS");
|
||||
return -2;
|
||||
}
|
||||
|
||||
uint32_t thread_list_size = 0;
|
||||
retval = target_read_u32(rtos->target,
|
||||
rtos->symbols[FreeRTOS_VAL_uxCurrentNumberOfTasks].address,
|
||||
rtos->symbols[FREERTOS_VAL_UX_CURRENT_NUMBER_OF_TASKS].address,
|
||||
&thread_list_size);
|
||||
LOG_DEBUG("FreeRTOS: Read uxCurrentNumberOfTasks at 0x%" PRIx64 ", value %" PRIu32,
|
||||
rtos->symbols[FreeRTOS_VAL_uxCurrentNumberOfTasks].address,
|
||||
rtos->symbols[FREERTOS_VAL_UX_CURRENT_NUMBER_OF_TASKS].address,
|
||||
thread_list_size);
|
||||
|
||||
if (retval != ERROR_OK) {
|
||||
|
@ -198,7 +198,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
|
|||
/* read the current thread */
|
||||
uint32_t pointer_casts_are_bad;
|
||||
retval = target_read_u32(rtos->target,
|
||||
rtos->symbols[FreeRTOS_VAL_pxCurrentTCB].address,
|
||||
rtos->symbols[FREERTOS_VAL_PX_CURRENT_TCB].address,
|
||||
&pointer_casts_are_bad);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("Error reading current thread in FreeRTOS thread list");
|
||||
|
@ -206,7 +206,7 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
|
|||
}
|
||||
rtos->current_thread = pointer_casts_are_bad;
|
||||
LOG_DEBUG("FreeRTOS: Read pxCurrentTCB at 0x%" PRIx64 ", value 0x%" PRIx64,
|
||||
rtos->symbols[FreeRTOS_VAL_pxCurrentTCB].address,
|
||||
rtos->symbols[FREERTOS_VAL_PX_CURRENT_TCB].address,
|
||||
rtos->current_thread);
|
||||
|
||||
if ((thread_list_size == 0) || (rtos->current_thread == 0)) {
|
||||
|
@ -243,18 +243,18 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
|
|||
}
|
||||
|
||||
/* Find out how many lists are needed to be read from pxReadyTasksLists, */
|
||||
if (rtos->symbols[FreeRTOS_VAL_uxTopUsedPriority].address == 0) {
|
||||
if (rtos->symbols[FREERTOS_VAL_UX_TOP_USED_PRIORITY].address == 0) {
|
||||
LOG_ERROR("FreeRTOS: uxTopUsedPriority is not defined, consult the OpenOCD manual for a work-around");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
uint32_t top_used_priority = 0;
|
||||
retval = target_read_u32(rtos->target,
|
||||
rtos->symbols[FreeRTOS_VAL_uxTopUsedPriority].address,
|
||||
rtos->symbols[FREERTOS_VAL_UX_TOP_USED_PRIORITY].address,
|
||||
&top_used_priority);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
LOG_DEBUG("FreeRTOS: Read uxTopUsedPriority at 0x%" PRIx64 ", value %" PRIu32,
|
||||
rtos->symbols[FreeRTOS_VAL_uxTopUsedPriority].address,
|
||||
rtos->symbols[FREERTOS_VAL_UX_TOP_USED_PRIORITY].address,
|
||||
top_used_priority);
|
||||
if (top_used_priority > FREERTOS_MAX_PRIORITIES) {
|
||||
LOG_ERROR("FreeRTOS top used priority is unreasonably big, not proceeding: %" PRIu32,
|
||||
|
@ -278,14 +278,14 @@ static int FreeRTOS_update_threads(struct rtos *rtos)
|
|||
|
||||
unsigned int num_lists;
|
||||
for (num_lists = 0; num_lists < config_max_priorities; num_lists++)
|
||||
list_of_lists[num_lists] = rtos->symbols[FreeRTOS_VAL_pxReadyTasksLists].address +
|
||||
list_of_lists[num_lists] = rtos->symbols[FREERTOS_VAL_PX_READY_TASKS_LISTS].address +
|
||||
num_lists * param->list_width;
|
||||
|
||||
list_of_lists[num_lists++] = rtos->symbols[FreeRTOS_VAL_xDelayedTaskList1].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FreeRTOS_VAL_xDelayedTaskList2].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FreeRTOS_VAL_xPendingReadyList].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FreeRTOS_VAL_xSuspendedTaskList].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FreeRTOS_VAL_xTasksWaitingTermination].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FREERTOS_VAL_X_DELAYED_TASK_LIST1].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FREERTOS_VAL_X_DELAYED_TASK_LIST2].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FREERTOS_VAL_X_PENDING_READY_LIST].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FREERTOS_VAL_X_SUSPENDED_TASK_LIST].address;
|
||||
list_of_lists[num_lists++] = rtos->symbols[FREERTOS_VAL_X_TASKS_WAITING_TERMINATION].address;
|
||||
|
||||
for (unsigned int i = 0; i < num_lists; i++) {
|
||||
if (list_of_lists[i] == 0)
|
||||
|
@ -536,7 +536,7 @@ static int FreeRTOS_get_thread_ascii_info(struct rtos *rtos, threadid_t thread_i
|
|||
static bool FreeRTOS_detect_rtos(struct target *target)
|
||||
{
|
||||
if ((target->rtos->symbols != NULL) &&
|
||||
(target->rtos->symbols[FreeRTOS_VAL_pxReadyTasksLists].address != 0)) {
|
||||
(target->rtos->symbols[FREERTOS_VAL_PX_READY_TASKS_LISTS].address != 0)) {
|
||||
/* looks like FreeRTOS */
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -180,9 +180,9 @@ static const struct ThreadX_params ThreadX_params_list[] = {
|
|||
};
|
||||
|
||||
enum ThreadX_symbol_values {
|
||||
ThreadX_VAL_tx_thread_current_ptr = 0,
|
||||
ThreadX_VAL_tx_thread_created_ptr = 1,
|
||||
ThreadX_VAL_tx_thread_created_count = 2,
|
||||
THREADX_VAL_TX_THREAD_CURRENT_PTR = 0,
|
||||
THREADX_VAL_TX_THREAD_CREATED_PTR = 1,
|
||||
THREADX_VAL_TX_THREAD_CREATED_COUNT = 2,
|
||||
};
|
||||
|
||||
static const char * const ThreadX_symbol_list[] = {
|
||||
|
@ -276,14 +276,14 @@ static int ThreadX_update_threads(struct rtos *rtos)
|
|||
return -4;
|
||||
}
|
||||
|
||||
if (rtos->symbols[ThreadX_VAL_tx_thread_created_count].address == 0) {
|
||||
if (rtos->symbols[THREADX_VAL_TX_THREAD_CREATED_COUNT].address == 0) {
|
||||
LOG_ERROR("Don't have the number of threads in ThreadX");
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* read the number of threads */
|
||||
retval = target_read_buffer(rtos->target,
|
||||
rtos->symbols[ThreadX_VAL_tx_thread_created_count].address,
|
||||
rtos->symbols[THREADX_VAL_TX_THREAD_CREATED_COUNT].address,
|
||||
4,
|
||||
(uint8_t *)&thread_list_size);
|
||||
|
||||
|
@ -297,7 +297,7 @@ static int ThreadX_update_threads(struct rtos *rtos)
|
|||
|
||||
/* read the current thread id */
|
||||
retval = target_read_buffer(rtos->target,
|
||||
rtos->symbols[ThreadX_VAL_tx_thread_current_ptr].address,
|
||||
rtos->symbols[THREADX_VAL_TX_THREAD_CURRENT_PTR].address,
|
||||
4,
|
||||
(uint8_t *)&rtos->current_thread);
|
||||
|
||||
|
@ -334,7 +334,7 @@ static int ThreadX_update_threads(struct rtos *rtos)
|
|||
/* Read the pointer to the first thread */
|
||||
int64_t thread_ptr = 0;
|
||||
retval = target_read_buffer(rtos->target,
|
||||
rtos->symbols[ThreadX_VAL_tx_thread_created_ptr].address,
|
||||
rtos->symbols[THREADX_VAL_TX_THREAD_CREATED_PTR].address,
|
||||
param->pointer_width,
|
||||
(uint8_t *)&thread_ptr);
|
||||
if (retval != ERROR_OK) {
|
||||
|
@ -492,7 +492,7 @@ static int ThreadX_get_symbol_list_to_lookup(struct symbol_table_elem *symbol_li
|
|||
static bool ThreadX_detect_rtos(struct target *target)
|
||||
{
|
||||
if ((target->rtos->symbols != NULL) &&
|
||||
(target->rtos->symbols[ThreadX_VAL_tx_thread_created_ptr].address != 0)) {
|
||||
(target->rtos->symbols[THREADX_VAL_TX_THREAD_CREATED_PTR].address != 0)) {
|
||||
/* looks like ThreadX */
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -62,13 +62,13 @@ static const char * const chromium_ec_symbol_list[] = {
|
|||
};
|
||||
|
||||
enum chromium_ec_symbol_values {
|
||||
CHROMIUM_EC_VAL_start_called = 0,
|
||||
CHROMIUM_EC_VAL_current_task,
|
||||
CHROMIUM_EC_VAL_tasks,
|
||||
CHROMIUM_EC_VAL_tasks_enabled,
|
||||
CHROMIUM_EC_VAL_tasks_ready,
|
||||
CHROMIUM_EC_VAL_task_names,
|
||||
CHROMIUM_EC_VAL_build_info,
|
||||
CHROMIUM_EC_VAL_START_CALLED = 0,
|
||||
CHROMIUM_EC_VAL_CURRENT_TASK,
|
||||
CHROMIUM_EC_VAL_TASKS,
|
||||
CHROMIUM_EC_VAL_TASKS_ENABLED,
|
||||
CHROMIUM_EC_VAL_TASKS_READY,
|
||||
CHROMIUM_EC_VAL_TASK_NAMES,
|
||||
CHROMIUM_EC_VAL_BUILD_INFO,
|
||||
|
||||
CHROMIUM_EC_VAL_COUNT,
|
||||
};
|
||||
|
@ -84,7 +84,7 @@ static bool chromium_ec_detect_rtos(struct target *target)
|
|||
if (!target || !target->rtos || !target->rtos->symbols)
|
||||
return false;
|
||||
|
||||
for (sym = CHROMIUM_EC_VAL_start_called;
|
||||
for (sym = CHROMIUM_EC_VAL_START_CALLED;
|
||||
sym < CHROMIUM_EC_VAL_COUNT; sym++) {
|
||||
if (target->rtos->symbols[sym].address) {
|
||||
LOG_DEBUG("Chromium-EC: Symbol \"%s\" found",
|
||||
|
@ -97,7 +97,7 @@ static bool chromium_ec_detect_rtos(struct target *target)
|
|||
}
|
||||
|
||||
ret = target_read_buffer(target,
|
||||
target->rtos->symbols[CHROMIUM_EC_VAL_build_info].address,
|
||||
target->rtos->symbols[CHROMIUM_EC_VAL_BUILD_INFO].address,
|
||||
sizeof(build_info_buf),
|
||||
(uint8_t *)build_info_buf);
|
||||
|
||||
|
@ -107,7 +107,7 @@ static bool chromium_ec_detect_rtos(struct target *target)
|
|||
LOG_INFO("Chromium-EC: Buildinfo: %s", build_info_buf);
|
||||
|
||||
return target->rtos->symbols &&
|
||||
target->rtos->symbols[CHROMIUM_EC_VAL_start_called].address;
|
||||
target->rtos->symbols[CHROMIUM_EC_VAL_START_CALLED].address;
|
||||
}
|
||||
|
||||
static int chromium_ec_create(struct target *target)
|
||||
|
@ -143,7 +143,7 @@ static int chromium_ec_get_current_task_ptr(struct rtos *rtos, uint32_t *current
|
|||
return ERROR_FAIL;
|
||||
|
||||
return target_read_u32(rtos->target,
|
||||
rtos->symbols[CHROMIUM_EC_VAL_current_task].address,
|
||||
rtos->symbols[CHROMIUM_EC_VAL_CURRENT_TASK].address,
|
||||
current_task);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ static int chromium_ec_get_num_tasks(struct rtos *rtos, int *num_tasks)
|
|||
int ret, t, found;
|
||||
|
||||
ret = target_read_u32(rtos->target,
|
||||
rtos->symbols[CHROMIUM_EC_VAL_tasks_enabled].address,
|
||||
rtos->symbols[CHROMIUM_EC_VAL_TASKS_ENABLED].address,
|
||||
&tasks_enabled);
|
||||
if (ret != ERROR_OK) {
|
||||
LOG_ERROR("Failed to determine #of tasks");
|
||||
|
@ -213,7 +213,7 @@ static int chromium_ec_update_threads(struct rtos *rtos)
|
|||
|
||||
/* One check if task switching has started ... */
|
||||
start_called = 0;
|
||||
ret = target_read_u32(rtos->target, rtos->symbols[CHROMIUM_EC_VAL_start_called].address,
|
||||
ret = target_read_u32(rtos->target, rtos->symbols[CHROMIUM_EC_VAL_START_CALLED].address,
|
||||
&start_called);
|
||||
if (ret != ERROR_OK) {
|
||||
LOG_ERROR("Failed to load start_called");
|
||||
|
@ -241,7 +241,7 @@ static int chromium_ec_update_threads(struct rtos *rtos)
|
|||
}
|
||||
|
||||
tasks_enabled = 0;
|
||||
ret = target_read_u32(rtos->target, rtos->symbols[CHROMIUM_EC_VAL_tasks_enabled].address,
|
||||
ret = target_read_u32(rtos->target, rtos->symbols[CHROMIUM_EC_VAL_TASKS_ENABLED].address,
|
||||
&tasks_enabled);
|
||||
if (ret != ERROR_OK) {
|
||||
LOG_ERROR("Failed to load tasks_enabled");
|
||||
|
@ -249,14 +249,14 @@ static int chromium_ec_update_threads(struct rtos *rtos)
|
|||
}
|
||||
|
||||
tasks_ready = 0;
|
||||
ret = target_read_u32(rtos->target, rtos->symbols[CHROMIUM_EC_VAL_tasks_ready].address,
|
||||
ret = target_read_u32(rtos->target, rtos->symbols[CHROMIUM_EC_VAL_TASKS_READY].address,
|
||||
&tasks_ready);
|
||||
if (ret != ERROR_OK) {
|
||||
LOG_ERROR("Failed to load tasks_ready");
|
||||
return ret;
|
||||
}
|
||||
|
||||
thread_ptr = rtos->symbols[CHROMIUM_EC_VAL_tasks].address;
|
||||
thread_ptr = rtos->symbols[CHROMIUM_EC_VAL_TASKS].address;
|
||||
|
||||
tasks_found = 0;
|
||||
for (t = 0; t < CROS_EC_MAX_TASKS; t++) {
|
||||
|
@ -268,7 +268,7 @@ static int chromium_ec_update_threads(struct rtos *rtos)
|
|||
|
||||
rtos->thread_details[tasks_found].threadid = thread_ptr;
|
||||
ret = target_read_u32(rtos->target,
|
||||
rtos->symbols[CHROMIUM_EC_VAL_task_names].address +
|
||||
rtos->symbols[CHROMIUM_EC_VAL_TASK_NAMES].address +
|
||||
params->ptr_size * t, &name_ptr);
|
||||
if (ret != ERROR_OK) {
|
||||
LOG_ERROR("Failed to read name_ptr");
|
||||
|
@ -348,7 +348,7 @@ static int chromium_ec_get_thread_reg_list(struct rtos *rtos,
|
|||
return ERROR_FAIL;
|
||||
|
||||
ret = target_read_u32(rtos->target,
|
||||
rtos->symbols[CHROMIUM_EC_VAL_tasks].address +
|
||||
rtos->symbols[CHROMIUM_EC_VAL_TASKS].address +
|
||||
params->task_offset_next * t,
|
||||
&stack_ptr);
|
||||
if (ret != ERROR_OK) {
|
||||
|
|
|
@ -49,12 +49,12 @@ struct rtos_type embKernel_rtos = {
|
|||
};
|
||||
|
||||
enum {
|
||||
SYMBOL_ID_sCurrentTask = 0,
|
||||
SYMBOL_ID_sListReady = 1,
|
||||
SYMBOL_ID_sListSleep = 2,
|
||||
SYMBOL_ID_sListSuspended = 3,
|
||||
SYMBOL_ID_sMaxPriorities = 4,
|
||||
SYMBOL_ID_sCurrentTaskCount = 5,
|
||||
SYMBOL_ID_S_CURRENT_TASK = 0,
|
||||
SYMBOL_ID_S_LIST_READY = 1,
|
||||
SYMBOL_ID_S_LIST_SLEEP = 2,
|
||||
SYMBOL_ID_S_LIST_SUSPENDED = 3,
|
||||
SYMBOL_ID_S_MAX_PRIORITIES = 4,
|
||||
SYMBOL_ID_S_CURRENT_TASK_COUNT = 5,
|
||||
};
|
||||
|
||||
static const char * const embKernel_symbol_list[] = {
|
||||
|
@ -111,7 +111,7 @@ static const struct embKernel_params embKernel_params_list[] = {
|
|||
static bool embKernel_detect_rtos(struct target *target)
|
||||
{
|
||||
if (target->rtos->symbols != NULL) {
|
||||
if (target->rtos->symbols[SYMBOL_ID_sCurrentTask].address != 0)
|
||||
if (target->rtos->symbols[SYMBOL_ID_S_CURRENT_TASK].address != 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -198,7 +198,7 @@ static int embKernel_update_threads(struct rtos *rtos)
|
|||
return -4;
|
||||
}
|
||||
|
||||
if (rtos->symbols[SYMBOL_ID_sCurrentTask].address == 0) {
|
||||
if (rtos->symbols[SYMBOL_ID_S_CURRENT_TASK].address == 0) {
|
||||
LOG_ERROR("Don't have the thread list head");
|
||||
return -2;
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ static int embKernel_update_threads(struct rtos *rtos)
|
|||
|
||||
param = (const struct embKernel_params *) rtos->rtos_specific_params;
|
||||
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_sCurrentTask].address, param->pointer_width,
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_S_CURRENT_TASK].address, param->pointer_width,
|
||||
(uint8_t *) &rtos->current_thread);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("Error reading current thread in embKernel thread list");
|
||||
|
@ -216,13 +216,13 @@ static int embKernel_update_threads(struct rtos *rtos)
|
|||
}
|
||||
|
||||
int64_t max_used_priority = 0;
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_sMaxPriorities].address, param->pointer_width,
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_S_MAX_PRIORITIES].address, param->pointer_width,
|
||||
(uint8_t *) &max_used_priority);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
int thread_list_size = 0;
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_sCurrentTaskCount].address,
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_S_CURRENT_TASK_COUNT].address,
|
||||
param->thread_count_width, (uint8_t *) &thread_list_size);
|
||||
|
||||
if (retval != ERROR_OK) {
|
||||
|
@ -243,7 +243,7 @@ static int embKernel_update_threads(struct rtos *rtos)
|
|||
/* Get first item in queue */
|
||||
int64_t iterable = 0;
|
||||
retval = target_read_buffer(rtos->target,
|
||||
rtos->symbols[SYMBOL_ID_sListReady].address + (pri * param->rtos_list_size), param->pointer_width,
|
||||
rtos->symbols[SYMBOL_ID_S_LIST_READY].address + (pri * param->rtos_list_size), param->pointer_width,
|
||||
(uint8_t *) &iterable);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
@ -261,7 +261,7 @@ static int embKernel_update_threads(struct rtos *rtos)
|
|||
}
|
||||
/* Look for sleeping tasks */
|
||||
int64_t iterable = 0;
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_sListSleep].address, param->pointer_width,
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_S_LIST_SLEEP].address, param->pointer_width,
|
||||
(uint8_t *) &iterable);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
@ -279,7 +279,7 @@ static int embKernel_update_threads(struct rtos *rtos)
|
|||
|
||||
/* Look for suspended tasks */
|
||||
iterable = 0;
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_sListSuspended].address, param->pointer_width,
|
||||
retval = target_read_buffer(rtos->target, rtos->symbols[SYMBOL_ID_S_LIST_SUSPENDED].address, param->pointer_width,
|
||||
(uint8_t *) &iterable);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
|
||||
/* types */
|
||||
enum mqx_symbols {
|
||||
mqx_VAL_mqx_kernel_data,
|
||||
mqx_VAL_MQX_init_struct,
|
||||
MQX_VAL_MQX_KERNEL_DATA,
|
||||
MQX_VAL_MQX_INIT_STRUCT,
|
||||
};
|
||||
|
||||
enum mqx_arch {
|
||||
|
@ -200,7 +200,7 @@ static int mqx_is_scheduler_running(
|
|||
|
||||
/* get '_mqx_kernel_data' symbol */
|
||||
if (ERROR_OK != mqx_get_symbol(
|
||||
rtos, mqx_VAL_mqx_kernel_data, &kernel_data_symbol
|
||||
rtos, MQX_VAL_MQX_KERNEL_DATA, &kernel_data_symbol
|
||||
)) {
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ static bool mqx_detect_rtos(
|
|||
{
|
||||
if (
|
||||
(target->rtos->symbols != NULL) &&
|
||||
(target->rtos->symbols[mqx_VAL_mqx_kernel_data].address != 0)
|
||||
(target->rtos->symbols[MQX_VAL_MQX_KERNEL_DATA].address != 0)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ static int mqx_update_threads(
|
|||
return ERROR_FAIL;
|
||||
/* get kernel_data symbol */
|
||||
if (ERROR_OK != mqx_get_symbol(
|
||||
rtos, mqx_VAL_mqx_kernel_data, &kernel_data_addr
|
||||
rtos, MQX_VAL_MQX_KERNEL_DATA, &kernel_data_addr
|
||||
)) {
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ static int mqx_get_thread_reg_list(
|
|||
return ERROR_FAIL;
|
||||
/* get kernel_data symbol */
|
||||
if (ERROR_OK != mqx_get_symbol(
|
||||
rtos, mqx_VAL_mqx_kernel_data, &kernel_data_addr
|
||||
rtos, MQX_VAL_MQX_KERNEL_DATA, &kernel_data_addr
|
||||
)) {
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
|
|
@ -101,18 +101,18 @@ static const char * const uCOS_III_symbol_list[] = {
|
|||
};
|
||||
|
||||
enum uCOS_III_symbol_values {
|
||||
uCOS_III_VAL_OSRunning,
|
||||
uCOS_III_VAL_OSTCBCurPtr,
|
||||
uCOS_III_VAL_OSTaskDbgListPtr,
|
||||
uCOS_III_VAL_OSTaskQty,
|
||||
UCOS_III_VAL_OS_RUNNING,
|
||||
UCOS_III_VAL_OS_TCB_CUR_PTR,
|
||||
UCOS_III_VAL_OS_TASK_DBG_LIST_PTR,
|
||||
UCOS_III_VAL_OS_TASK_QTY,
|
||||
|
||||
/* also see: contrib/rtos-helpers/uCOS-III-openocd.c */
|
||||
uCOS_III_VAL_OS_TCB_StkPtr_offset,
|
||||
uCOS_III_VAL_OS_TCB_NamePtr_offset,
|
||||
uCOS_III_VAL_OS_TCB_TaskState_offset,
|
||||
uCOS_III_VAL_OS_TCB_Prio_offset,
|
||||
uCOS_III_VAL_OS_TCB_DbgPrevPtr_offset,
|
||||
uCOS_III_VAL_OS_TCB_DbgNextPtr_offset,
|
||||
UCOS_III_VAL_OS_TCB_STK_PTR_OFFSET,
|
||||
UCOS_III_VAL_OS_TCB_NAME_PTR_OFFSET,
|
||||
UCOS_III_VAL_OS_TCB_TASK_STATE_OFFSET,
|
||||
UCOS_III_VAL_OS_TCB_PRIO_OFFSET,
|
||||
UCOS_III_VAL_OS_TCB_DBG_PREV_PTR_OFFSET,
|
||||
UCOS_III_VAL_OS_TCB_DBG_NEXT_PTR_OFFSET,
|
||||
};
|
||||
|
||||
static const char * const uCOS_III_thread_state_list[] = {
|
||||
|
@ -173,7 +173,7 @@ static int uCOS_III_find_last_thread_address(struct rtos *rtos, symbol_address_t
|
|||
symbol_address_t thread_list_address = 0;
|
||||
|
||||
retval = target_read_memory(rtos->target,
|
||||
rtos->symbols[uCOS_III_VAL_OSTaskDbgListPtr].address,
|
||||
rtos->symbols[UCOS_III_VAL_OS_TASK_DBG_LIST_PTR].address,
|
||||
params->pointer_width,
|
||||
1,
|
||||
(void *)&thread_list_address);
|
||||
|
@ -212,27 +212,27 @@ static int uCOS_III_update_thread_offsets(struct rtos *rtos)
|
|||
symbol_address_t *thread_offset;
|
||||
} thread_offset_maps[] = {
|
||||
{
|
||||
uCOS_III_VAL_OS_TCB_StkPtr_offset,
|
||||
UCOS_III_VAL_OS_TCB_STK_PTR_OFFSET,
|
||||
¶ms->thread_stack_offset,
|
||||
},
|
||||
{
|
||||
uCOS_III_VAL_OS_TCB_NamePtr_offset,
|
||||
UCOS_III_VAL_OS_TCB_NAME_PTR_OFFSET,
|
||||
¶ms->thread_name_offset,
|
||||
},
|
||||
{
|
||||
uCOS_III_VAL_OS_TCB_TaskState_offset,
|
||||
UCOS_III_VAL_OS_TCB_TASK_STATE_OFFSET,
|
||||
¶ms->thread_state_offset,
|
||||
},
|
||||
{
|
||||
uCOS_III_VAL_OS_TCB_Prio_offset,
|
||||
UCOS_III_VAL_OS_TCB_PRIO_OFFSET,
|
||||
¶ms->thread_priority_offset,
|
||||
},
|
||||
{
|
||||
uCOS_III_VAL_OS_TCB_DbgPrevPtr_offset,
|
||||
UCOS_III_VAL_OS_TCB_DBG_PREV_PTR_OFFSET,
|
||||
¶ms->thread_prev_offset,
|
||||
},
|
||||
{
|
||||
uCOS_III_VAL_OS_TCB_DbgNextPtr_offset,
|
||||
UCOS_III_VAL_OS_TCB_DBG_NEXT_PTR_OFFSET,
|
||||
¶ms->thread_next_offset,
|
||||
},
|
||||
};
|
||||
|
@ -258,7 +258,7 @@ static int uCOS_III_update_thread_offsets(struct rtos *rtos)
|
|||
static bool uCOS_III_detect_rtos(struct target *target)
|
||||
{
|
||||
return target->rtos->symbols != NULL &&
|
||||
target->rtos->symbols[uCOS_III_VAL_OSRunning].address != 0;
|
||||
target->rtos->symbols[UCOS_III_VAL_OS_RUNNING].address != 0;
|
||||
}
|
||||
|
||||
static int uCOS_III_reset_handler(struct target *target, enum target_reset_mode reset_mode, void *priv)
|
||||
|
@ -312,7 +312,7 @@ static int uCOS_III_update_threads(struct rtos *rtos)
|
|||
uint8_t rtos_running;
|
||||
|
||||
retval = target_read_u8(rtos->target,
|
||||
rtos->symbols[uCOS_III_VAL_OSRunning].address,
|
||||
rtos->symbols[UCOS_III_VAL_OS_RUNNING].address,
|
||||
&rtos_running);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("uCOS-III: failed to read RTOS running");
|
||||
|
@ -350,7 +350,7 @@ static int uCOS_III_update_threads(struct rtos *rtos)
|
|||
symbol_address_t current_thread_address = 0;
|
||||
|
||||
retval = target_read_memory(rtos->target,
|
||||
rtos->symbols[uCOS_III_VAL_OSTCBCurPtr].address,
|
||||
rtos->symbols[UCOS_III_VAL_OS_TCB_CUR_PTR].address,
|
||||
params->pointer_width,
|
||||
1,
|
||||
(void *)¤t_thread_address);
|
||||
|
@ -361,7 +361,7 @@ static int uCOS_III_update_threads(struct rtos *rtos)
|
|||
|
||||
/* read number of tasks */
|
||||
retval = target_read_u16(rtos->target,
|
||||
rtos->symbols[uCOS_III_VAL_OSTaskQty].address,
|
||||
rtos->symbols[UCOS_III_VAL_OS_TASK_QTY].address,
|
||||
(void *)&rtos->thread_count);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("uCOS-III: failed to read thread count");
|
||||
|
|
Loading…
Reference in New Issue