openocd: src/rtos: replace the GPL-2.0-or-later license tag
[fw/openocd] / src / rtos / ThreadX.c
index c7effe79f961345d1486187a761e722fc8616989..a60d5f8bb0a2b1792ddfebb603f0ada3c9c8eb90 100644 (file)
@@ -1,19 +1,8 @@
+/* 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
@@ -112,18 +101,16 @@ static const struct stack_register_offset rtos_threadx_arm926ejs_stack_offsets_i
 
 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
 },
 };
 
@@ -177,6 +164,18 @@ static const struct threadx_params threadx_params_list[] = {
        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 {
@@ -491,7 +490,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) &&
+       if ((target->rtos->symbols) &&
                        (target->rtos->symbols[THREADX_VAL_TX_THREAD_CREATED_PTR].address != 0)) {
                /* looks like ThreadX */
                return true;