+// SPDX-License-Identifier: GPL-2.0-or-later
+
/***************************************************************************
* Copyright (C) 2011 by Broadcom Corporation *
* Evan Hunter - ehunter@broadcom.com *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
static const struct rtos_register_stacking rtos_threadx_arm926ejs_stacking[] = {
{
- ARM926EJS_REGISTERS_SIZE_SOLICITED, /* stack_registers_size */
- -1, /* stack_growth_direction */
- 17, /* num_output_registers */
- NULL, /* stack_alignment */
- rtos_threadx_arm926ejs_stack_offsets_solicited /* register_offsets */
+ .stack_registers_size = ARM926EJS_REGISTERS_SIZE_SOLICITED,
+ .stack_growth_direction = -1,
+ .num_output_registers = 17,
+ .register_offsets = rtos_threadx_arm926ejs_stack_offsets_solicited
},
{
- ARM926EJS_REGISTERS_SIZE_INTERRUPT, /* stack_registers_size */
- -1, /* stack_growth_direction */
- 17, /* num_output_registers */
- NULL, /* stack_alignment */
- rtos_threadx_arm926ejs_stack_offsets_interrupt /* register_offsets */
+ .stack_registers_size = ARM926EJS_REGISTERS_SIZE_INTERRUPT,
+ .stack_growth_direction = -1,
+ .num_output_registers = 17,
+ .register_offsets = rtos_threadx_arm926ejs_stack_offsets_interrupt
},
};
get_stacking_info_arm926ejs, /* fn_get_stacking_info */
is_thread_id_valid_arm926ejs, /* fn_is_thread_id_valid */
},
+ {
+ "hla_target", /* target_name */
+ 4, /* pointer_width; */
+ 8, /* thread_stack_offset; */
+ 40, /* thread_name_offset; */
+ 48, /* thread_state_offset; */
+ 136, /* thread_next_offset */
+ &rtos_standard_cortex_m3_stacking, /* stacking_info */
+ 1, /* stacking_info_nb */
+ NULL, /* fn_get_stacking_info */
+ NULL, /* fn_is_thread_id_valid */
+ },
};
enum threadx_symbol_values {
{
const struct threadx_params *param = (const struct threadx_params *) rtos->rtos_specific_params;
- if (param->fn_get_stacking_info != NULL)
+ if (param->fn_get_stacking_info)
return param->fn_get_stacking_info(rtos, stack_ptr);
return param->stacking_info + 0;
{
const struct threadx_params *param;
- if (rtos->rtos_specific_params == NULL)
+ if (!rtos->rtos_specific_params)
return 0; /* invalid */
param = (const struct threadx_params *) rtos->rtos_specific_params;
- if (param->fn_is_thread_id_valid != NULL)
+ if (param->fn_is_thread_id_valid)
return param->fn_is_thread_id_valid(rtos, thread_id);
return (thread_id != 0);
int thread_list_size = 0;
const struct threadx_params *param;
- if (rtos == NULL)
+ if (!rtos)
return -1;
- if (rtos->rtos_specific_params == NULL)
+ if (!rtos->rtos_specific_params)
return -3;
param = (const struct threadx_params *) rtos->rtos_specific_params;
- if (rtos->symbols == NULL) {
+ if (!rtos->symbols) {
LOG_ERROR("No symbols for ThreadX");
return -4;
}
int retval;
const struct threadx_params *param;
- if (rtos == NULL)
+ if (!rtos)
return -1;
if (!is_thread_id_valid(rtos, thread_id))
return -2;
- if (rtos->rtos_specific_params == NULL)
+ if (!rtos->rtos_specific_params)
return -3;
param = (const struct threadx_params *) rtos->rtos_specific_params;
const struct rtos_register_stacking *stacking_info =
get_stacking_info(rtos, stack_ptr);
- if (stacking_info == NULL) {
+ if (!stacking_info) {
LOG_ERROR("Unknown stacking info for thread id=0x%" PRIx64, (uint64_t)thread_id);
return -6;
}
static bool threadx_detect_rtos(struct target *target)
{
- if ((target->rtos->symbols != NULL) &&
+ if ((target->rtos->symbols) &&
(target->rtos->symbols[THREADX_VAL_TX_THREAD_CREATED_PTR].address != 0)) {
/* looks like ThreadX */
return true;
const struct threadx_params *param;
- if (rtos == NULL)
+ if (!rtos)
return -1;
if (thread_id == 0)
return -2;
- if (rtos->rtos_specific_params == NULL)
+ if (!rtos->rtos_specific_params)
return -3;
param = (const struct threadx_params *) rtos->rtos_specific_params;
- if (rtos->symbols == NULL) {
+ if (!rtos->symbols) {
LOG_ERROR("No symbols for ThreadX");
return -3;
}