aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-11-17 00:19:56 -0800
committerMike Frysinger <vapier@gentoo.org>2015-11-17 23:12:58 -0500
commitcdf850e9d953f765f600e1ecae61664eab5ae7f1 (patch)
treee1c1cdd1a624d9f7c8b55143b73e9b131b034bde /sim/common
parent8fd3fe9331ea62972272f0f9f7dfcb7d39a7d2f5 (diff)
downloadgdb-cdf850e9d953f765f600e1ecae61664eab5ae7f1.zip
gdb-cdf850e9d953f765f600e1ecae61664eab5ae7f1.tar.gz
gdb-cdf850e9d953f765f600e1ecae61664eab5ae7f1.tar.bz2
sim: always enable modulo memory
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.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/sim-config.h4
-rw-r--r--sim/common/sim-core.c24
-rw-r--r--sim/common/sim-core.h7
4 files changed, 14 insertions, 29 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 7c0ef37..ddf4558 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -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.
diff --git a/sim/common/sim-config.h b/sim/common/sim-config.h
index f4fe076..d34ae88 100644
--- a/sim/common/sim-config.h
+++ b/sim/common/sim-config.h
@@ -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:
diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c
index 43e9076..724a036 100644
--- a/sim/common/sim-core.c
+++ b/sim/common/sim-core.c
@@ -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));
}
diff --git a/sim/common/sim-core.h b/sim/common/sim-core.h
index 64d2508..a60e60a 100644
--- a/sim/common/sim-core.h
+++ b/sim/common/sim-core.h
@@ -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