]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: always enable modulo memory
authorMike Frysinger <vapier@gentoo.org>
Tue, 17 Nov 2015 08:19:56 +0000 (00:19 -0800)
committerMike Frysinger <vapier@gentoo.org>
Wed, 18 Nov 2015 04:12:58 +0000 (23:12 -0500)
Having this be a config option doesn't make sense: the code size is
pretty much the same (as all the logic is still active), and if it's
disabled, the sim throws an error if you try to use it.  That means
we can't break sims that weren't using it before by enabling it all
the time.

12 files changed:
sim/bfin/ChangeLog
sim/bfin/tconfig.h
sim/common/ChangeLog
sim/common/sim-config.h
sim/common/sim-core.c
sim/common/sim-core.h
sim/m68hc11/ChangeLog
sim/m68hc11/sim-main.h
sim/mips/ChangeLog
sim/mips/sim-main.h
sim/v850/ChangeLog
sim/v850/sim-main.h

index 444500634601641b25f1dcf2d8b29d9faff2a33f..ac4b7742005fde361c696171fd3f592cf75fbd0d 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * tconfig.h (WITH_MODULO_MEMORY): Delete.
+
 2015-11-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-reason.o, sim-reg.o, and
index d28fd8d9f59df3214331b94e6f9f91b71c61dc4e..a3e6f7bf7c1e73898c81488f949ac55a77841fb4 100644 (file)
@@ -9,7 +9,3 @@
 
 /* ??? Temporary hack until model support unified.  */
 #define SIM_HAVE_MODEL
-
-/* Allows us to do the memory aliasing that some bfroms have:
-   {0xef000000 - 0xef100000} => {0xef000000 - 0xef000800}  */
-#define WITH_MODULO_MEMORY 1
index 7c0ef379931a908b00b8e50d5561c8d8487f3197..ddf4558ed2fa14742b51b2f47a19ce7b50f1de12 100644 (file)
@@ -1,3 +1,11 @@
+2015-11-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (WITH_MODULO_MEMORY): Delete.
+       * sim-core.c (new_sim_core_mapping): Always assign mask to modulo-1.
+       (sim_core_attach): Delete WITH_MODULO_MEMORY == 0 logic.
+       (sim_core_translate): Likewise.
+       * sim-core.h: Delete mention of WITH_MODULO_MEMORY.
+
 2015-11-16  Mike Frysinger  <vapier@gentoo.org>
 
        * sim-close.c (__cgen_cpu_close, _cgen_cpu_close): Delete.
index f4fe076ba166cf0e3c95991fbf96e3b4a92202b4..d34ae88129fc26428ebee3153a35122947cd3e5d 100644 (file)
@@ -398,10 +398,6 @@ extern char *simulator_sysroot;
 #define WITH_CALLBACK_MEMORY           1
 #endif
 
-#ifndef WITH_MODULO_MEMORY
-#define WITH_MODULO_MEMORY              0
-#endif
-
 
 
 /* Alignment:
index 43e9076950f04f5c505ebabcbb71706d77a7f56d..724a036fe70bb873ea83ea2bd9a67eeaf3ebae62 100644 (file)
@@ -157,10 +157,7 @@ new_sim_core_mapping (SIM_DESC sd,
   new_mapping->base = addr;
   new_mapping->nr_bytes = nr_bytes;
   new_mapping->bound = addr + (nr_bytes - 1);
-  if (modulo == 0)
-    new_mapping->mask = (unsigned) 0 - 1;
-  else
-    new_mapping->mask = modulo - 1;
+  new_mapping->mask = modulo - 1;
   new_mapping->buffer = buffer;
   new_mapping->free_buffer = free_buffer;
   new_mapping->device = device;
@@ -298,17 +295,6 @@ sim_core_attach (SIM_DESC sd,
   if (cpu != NULL)
     sim_io_error (sd, "sim_core_map_attach - processor specific memory map not yet supported");
 
-  /* verify modulo memory */
-  if (!WITH_MODULO_MEMORY && modulo != 0)
-    {
-#if (WITH_DEVICES)
-      device_error (client, "sim_core_attach - internal error - modulo memory disabled");
-#endif
-#if (WITH_HW)
-      sim_hw_abort (sd, client, "sim_core_attach - internal error - modulo memory disabled");
-#endif
-      sim_io_error (sd, "sim_core_attach - internal error - modulo memory disabled");
-    }
   if (client != NULL && modulo != 0)
     {
 #if (WITH_DEVICES)
@@ -497,12 +483,8 @@ STATIC_INLINE_SIM_CORE\
 sim_core_translate (sim_core_mapping *mapping,
                    address_word addr)
 {
-  if (WITH_MODULO_MEMORY)
-    return (void *)((unsigned8 *) mapping->buffer
-                   + ((addr - mapping->base) & mapping->mask));
-  else
-    return (void *)((unsigned8 *) mapping->buffer
-                   + addr - mapping->base);
+  return (void *)((unsigned8 *) mapping->buffer
+                 + ((addr - mapping->base) & mapping->mask));
 }
 
 
index 64d2508c16ce42e8cade4f2bbe88bac4f2c4426d..a60e60af2cba1e4f6143b5ac9aff9ca1b5b80261 100644 (file)
@@ -119,10 +119,9 @@ extern SIM_RC sim_core_install (SIM_DESC sd);
    translated into ADDRESS_SPACE:OFFSET before being passed to the
    client device.
 
-   MODULO - when the simulator has been configured WITH_MODULO support
-   and is greater than zero, specifies that accesses to the region
-   [ADDR .. ADDR+NR_BYTES) should be mapped onto the sub region [ADDR
-   .. ADDR+MODULO).  The modulo value must be a power of two.
+   MODULO - Specifies that accesses to the region [ADDR .. ADDR+NR_BYTES)
+   should be mapped onto the sub region [ADDR .. ADDR+MODULO).  The modulo
+   value must be a power of two.
 
    DEVICE - When non NULL, indicates that this is a callback memory
    space and specified device's memory callback handler should be
index 1f8d0cfd9006a53876702774a5b17403401e08a2..8e2d1a509cf57c501f88add0ce1201e272e12c68 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (WITH_MODULO_MEMORY): Delete.
+
 2015-11-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
index d1fc582e6811092da695a453377462c7efcb1483..be33b48f531f28cdc94ef0902034ca7f2f4fb5ba 100644 (file)
@@ -20,7 +20,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifndef _SIM_MAIN_H
 #define _SIM_MAIN_H
 
-#define WITH_MODULO_MEMORY 1
 #define WITH_WATCHPOINTS 1
 #define SIM_HANDLES_LMA 1
 
index 706b0fcf84de35f189fae5e538a08a4755dd7489..d37ab7a3a5dc53c42e731cead7fd862238586abc 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (WITH_MODULO_MEMORY): Delete.
+
 2015-11-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
index adf60c7885c83bcd407da37e18d076b7e2921edf..bb64dcb6ab1458d131f9eeb46d92f5bad9751743 100644 (file)
@@ -22,7 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* hobble some common features for moment */
 #define WITH_WATCHPOINTS 1
-#define WITH_MODULO_MEMORY 1
 
 
 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
index 6e94282447a51c8ff24e00344372fde1db9aebd1..7efd9d15bc3413a9570b2023bd125317c7350dda 100644 (file)
@@ -1,3 +1,7 @@
+2015-11-17  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-main.h (WITH_MODULO_MEMORY): Delete.
+
 2015-11-15  Mike Frysinger  <vapier@gentoo.org>
 
        * Makefile.in (SIM_OBJS): Delete sim-reason.o and sim-stop.o.
index 5127d2801025fff1277a1ccbda98abbb9d4e116e..0c041ba2ccdaefd4ea2182b41ce4942f518c96df 100644 (file)
@@ -4,7 +4,6 @@
 /* General config options */
 
 #define WITH_CORE
-#define WITH_MODULO_MEMORY 1
 #define WITH_WATCHPOINTS 1