diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-06-28 21:42:56 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-06-30 01:52:51 -0400 |
commit | 1c636da093f335cd57e7fca0fc25ae9f9e849264 (patch) | |
tree | e33d33c678ae988d2ad31027bb2b23c8f009e34e /sim/or1k | |
parent | f8261de1b22cc1a72ae18a2300df8b2cf7f027db (diff) | |
download | fsf-binutils-gdb-1c636da093f335cd57e7fca0fc25ae9f9e849264.zip fsf-binutils-gdb-1c636da093f335cd57e7fca0fc25ae9f9e849264.tar.gz fsf-binutils-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/or1k')
-rw-r--r-- | sim/or1k/ChangeLog | 7 | ||||
-rw-r--r-- | sim/or1k/arch.c | 2 | ||||
-rw-r--r-- | sim/or1k/sim-if.c | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/sim/or1k/ChangeLog b/sim/or1k/ChangeLog index 89a89ac..94e7e0e 100644 --- a/sim/or1k/ChangeLog +++ b/sim/or1k/ChangeLog @@ -1,3 +1,10 @@ +2021-06-30 Mike Frysinger <vapier@gentoo.org> + + * arch.c (sim_machs): Rename to ... + (or1k_sim_machs): ... this. + * sim-if.c (or1k_sim_machs): New decl. + (sim_open): Set STATE_MACH. + 2021-06-29 Mike Frysinger <vapier@gentoo.org> * arch.c (sim_machs): Mark const. diff --git a/sim/or1k/arch.c b/sim/or1k/arch.c index ef3c403..87b3724 100644 --- a/sim/or1k/arch.c +++ b/sim/or1k/arch.c @@ -25,7 +25,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 or1k_sim_machs[] = { #ifdef HAVE_CPU_OR1K32BF & or32_mach, diff --git a/sim/or1k/sim-if.c b/sim/or1k/sim-if.c index 06d7dcb..e835388 100644 --- a/sim/or1k/sim-if.c +++ b/sim/or1k/sim-if.c @@ -150,6 +150,8 @@ or1k_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt, char *arg, return SIM_RC_FAIL; } +extern const SIM_MACH * const or1k_sim_machs[]; + /* Create an instance of the simulator. */ SIM_DESC @@ -161,6 +163,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd, int i; /* Set default options before parsing user options. */ + STATE_MACHS (sd) = or1k_sim_machs; current_target_byte_order = BFD_ENDIAN_BIG; /* The cpu data is kept in a separately allocated chunk of memory. */ |