openocd: remove CamelCase symbols *xPSR*
[fw/openocd] / src / rtos / nuttx.c
index c52547120c1383688324520d6c9819bbab2fdada..6b20ed322342c732d70af03982dee39cc8f88b5a 100644 (file)
@@ -1,20 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
 /***************************************************************************
  *   Copyright 2016,2017 Sony Video & Sound Products Inc.                  *
  *   Masatoshi Tateishi - Masatoshi.Tateishi@jp.sony.com                   *
  *   Masayuki Ishikawa - Masayuki.Ishikawa@jp.sony.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
@@ -114,16 +103,15 @@ static const struct stack_register_offset nuttx_stack_offsets_cortex_m[] = {
        { ARMV7M_R13,     0,  32 },             /* sp   */
        { ARMV7M_R14,   0x3c, 32 },             /* lr   */
        { ARMV7M_PC,    0x40, 32 },             /* pc   */
-       { ARMV7M_xPSR,  0x44, 32 },             /* xPSR */
+       { ARMV7M_XPSR,  0x44, 32 },             /* xPSR */
 };
 
 
 static const struct rtos_register_stacking nuttx_stacking_cortex_m = {
-       0x48,                                   /* stack_registers_size */
-       -1,                                     /* stack_growth_direction */
-       17,                                     /* num_output_registers */
-       0,                                      /* stack_alignment */
-       nuttx_stack_offsets_cortex_m   /* register_offsets */
+       .stack_registers_size = 0x48,
+       .stack_growth_direction = -1,
+       .num_output_registers = 17,
+       .register_offsets = nuttx_stack_offsets_cortex_m
 };
 
 static const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu[] = {
@@ -143,15 +131,14 @@ static const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu[] = {
        { ARMV7M_R13,     0,  32 },             /* sp   */
        { ARMV7M_R14,   0x80, 32 },             /* lr   */
        { ARMV7M_PC,    0x84, 32 },             /* pc   */
-       { ARMV7M_xPSR,  0x88, 32 },             /* xPSR */
+       { ARMV7M_XPSR,  0x88, 32 },             /* xPSR */
 };
 
 static const struct rtos_register_stacking nuttx_stacking_cortex_m_fpu = {
-       0x8c,                                   /* stack_registers_size */
-       -1,                                     /* stack_growth_direction */
-       17,                                     /* num_output_registers */
-       0,                                      /* stack_alignment */
-       nuttx_stack_offsets_cortex_m_fpu        /* register_offsets */
+       .stack_registers_size = 0x8c,
+       .stack_growth_direction = -1,
+       .num_output_registers = 17,
+       .register_offsets = nuttx_stack_offsets_cortex_m_fpu
 };
 
 static int pid_offset = PID;
@@ -233,7 +220,7 @@ retok:
 
 static bool nuttx_detect_rtos(struct target *target)
 {
-       if ((target->rtos->symbols != NULL) &&
+       if ((target->rtos->symbols) &&
                        (target->rtos->symbols[0].address != 0) &&
                        (target->rtos->symbols[1].address != 0)) {
                return true;
@@ -259,7 +246,7 @@ static int nuttx_update_threads(struct rtos *rtos)
        uint32_t i;
        uint8_t state;
 
-       if (rtos->symbols == NULL) {
+       if (!rtos->symbols) {
                LOG_ERROR("No symbols for NuttX");
                return -3;
        }