aboutsummaryrefslogtreecommitdiff
path: root/sim/cris
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-28 21:42:56 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-30 01:52:51 -0400
commit1c636da093f335cd57e7fca0fc25ae9f9e849264 (patch)
treee33d33c678ae988d2ad31027bb2b23c8f009e34e /sim/cris
parentf8261de1b22cc1a72ae18a2300df8b2cf7f027db (diff)
downloadgdb-1c636da093f335cd57e7fca0fc25ae9f9e849264.zip
gdb-1c636da093f335cd57e7fca0fc25ae9f9e849264.tar.gz
gdb-1c636da093f335cd57e7fca0fc25ae9f9e849264.tar.bz2
sim: namespace sim_machs
We want to do a single build with all arches in one binary which means we need to namespace sim_machs on a per-arch basis. Move it from a global variable to the sim description structure so it can be setup at runtime. Changing the SIM_MODEL->num from an enum to an int is unfortunate, but we specifically don't want to maintain a centralized list anymore, and this was never used directly in common code, just passed to per-arch callbacks.
Diffstat (limited to 'sim/cris')
-rw-r--r--sim/cris/ChangeLog7
-rw-r--r--sim/cris/arch.c2
-rw-r--r--sim/cris/sim-if.c3
3 files changed, 11 insertions, 1 deletions
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index bb67da6..2920850 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,3 +1,10 @@
+2021-06-30 Mike Frysinger <vapier@gentoo.org>
+
+ * arch.c (sim_machs): Rename to ...
+ (cris_sim_machs): ... this.
+ * sim-if.c (cris_sim_machs): New decl.
+ (sim_open): Set STATE_MACH.
+
2021-06-29 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (stamp-v10fcpu): Do not insert cgen-ops.h include.
diff --git a/sim/cris/arch.c b/sim/cris/arch.c
index 1635ef6..cd83ede 100644
--- a/sim/cris/arch.c
+++ b/sim/cris/arch.c
@@ -24,7 +24,7 @@ This file is part of the GNU simulators.
#include "sim-main.h"
#include "bfd.h"
-const SIM_MACH * const sim_machs[] =
+const SIM_MACH * const cris_sim_machs[] =
{
#ifdef HAVE_CPU_CRISV10F
& crisv10_mach,
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index 9924939..37a1d5b 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -608,6 +608,8 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd)
return ok;
}
+extern const SIM_MACH * const cris_sim_machs[];
+
/* Create an instance of the simulator. */
SIM_DESC
@@ -656,6 +658,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
bfd_byte sp_init[4] = {0, 0, 0, 0};
/* Set default options before parsing user options. */
+ STATE_MACHS (sd) = cris_sim_machs;
current_target_byte_order = BFD_ENDIAN_LITTLE;
/* The cpu data is kept in a separately allocated chunk of memory. */