Adjust gdb.mi/mi-sym-info.exp filename patterns.
[deliverable/binutils-gdb.git] / sim / bfin / dv-bfin_wp.c
index efa0804fe66e44fab9c365fcecdb30d40c913594..5ab4729b4deae7b4b64812cc2d589e14a3a434ec 100644 (file)
@@ -1,6 +1,6 @@
 /* Blackfin Watchpoint (WP) model.
 
-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2020 Free Software Foundation, Inc.
    Contributed by Analog Devices, Inc.
 
    This file is part of simulators.
@@ -54,7 +54,8 @@ struct bfin_wp
 #define mmr_offset(mmr) (offsetof(struct bfin_wp, mmr) - mmr_base())
 #define mmr_idx(mmr)    (mmr_offset (mmr) / 4)
 
-static const char * const mmr_names[] = {
+static const char * const mmr_names[] =
+{
   [mmr_idx (iactl)] = "WPIACTL",
   [mmr_idx (ia)]    = "WPIA0", "WPIA1", "WPIA2", "WPIA3", "WPIA4", "WPIA5",
   [mmr_idx (iacnt)] = "WPIACNT0", "WPIACNT1", "WPIACNT2",
@@ -76,6 +77,10 @@ bfin_wp_io_write_buffer (struct hw *me, const void *source, int space,
   bu32 value;
   bu32 *valuep;
 
+  /* Invalid access mode is higher priority than missing register.  */
+  if (!dv_bfin_mmr_require_32 (me, addr, nr_bytes, true))
+    return 0;
+
   value = dv_load_4 (source);
   mmr_off = addr - wp->base;
   valuep = (void *)((unsigned long)wp + mmr_base() + mmr_off);
@@ -98,7 +103,7 @@ bfin_wp_io_write_buffer (struct hw *me, const void *source, int space,
       break;
     default:
       dv_bfin_mmr_invalid (me, addr, nr_bytes, true);
-      break;
+      return 0;
     }
 
   return nr_bytes;
@@ -113,6 +118,10 @@ bfin_wp_io_read_buffer (struct hw *me, void *dest, int space,
   bu32 value;
   bu32 *valuep;
 
+  /* Invalid access mode is higher priority than missing register.  */
+  if (!dv_bfin_mmr_require_32 (me, addr, nr_bytes, false))
+    return 0;
+
   mmr_off = addr - wp->base;
   valuep = (void *)((unsigned long)wp + mmr_base() + mmr_off);
 
@@ -130,9 +139,8 @@ bfin_wp_io_read_buffer (struct hw *me, void *dest, int space,
       value = *valuep;
       break;
     default:
-      while (1) /* Core MMRs -> exception -> doesn't return.  */
-       dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
-      break;
+      dv_bfin_mmr_invalid (me, addr, nr_bytes, false);
+      return 0;
     }
 
   dv_store_4 (dest, value);
@@ -182,7 +190,8 @@ bfin_wp_finish (struct hw *me)
   attach_bfin_wp_regs (me, wp);
 }
 
-const struct hw_descriptor dv_bfin_wp_descriptor[] = {
+const struct hw_descriptor dv_bfin_wp_descriptor[] =
+{
   {"bfin_wp", bfin_wp_finish,},
   {NULL, NULL},
 };
This page took 0.029455 seconds and 4 git commands to generate.