stlink: Add PID for V3 device without MSD
[fw/openocd] / src / target / nds32_reg.c
index 72ac4798ca2864ab25df20208bbae20134dd833e..034a075841c41c48bf196ef566420eeadb3a520c 100644 (file)
@@ -13,9 +13,7 @@
  *   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, write to the                         *
- *   Free Software Foundation, Inc.,                                       *
- *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -26,7 +24,7 @@
 
 static bool nds32_reg_init_done;
 static struct nds32_reg_s nds32_regs[TOTAL_REG_NUM];
-static struct nds32_reg_exception_s nds32_ex_reg_values[] = {
+static const struct nds32_reg_exception_s nds32_ex_reg_values[] = {
        {IR0, 3, 0x3, 2},
        {IR0, 3, 0x3, 3},
        {IR1, 3, 0x3, 2},
@@ -358,7 +356,7 @@ const char *nds32_reg_symbolic_name(uint32_t number)
 bool nds32_reg_exception(uint32_t number, uint32_t value)
 {
        int i;
-       struct nds32_reg_exception_s *ex_reg_value;
+       const struct nds32_reg_exception_s *ex_reg_value;
        uint32_t field_value;
 
        i = 0;
@@ -369,7 +367,7 @@ bool nds32_reg_exception(uint32_t number, uint32_t value)
                        field_value = (value >> ex_reg_value->ex_value_bit_pos) &
                                ex_reg_value->ex_value_mask;
                        if (field_value == ex_reg_value->ex_value) {
-                               LOG_WARNING("It will generate exceptions as setting %d to %s",
+                               LOG_WARNING("It will generate exceptions as setting %" PRIu32 " to %s",
                                                value, nds32_regs[number].simple_mnemonic);
                                return true;
                        }