aboutsummaryrefslogtreecommitdiff
path: root/sim/bfin
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/bfin
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/bfin')
-rw-r--r--sim/bfin/ChangeLog7
-rw-r--r--sim/bfin/interp.c1
-rw-r--r--sim/bfin/machs.c2
-rw-r--r--sim/bfin/machs.h1
4 files changed, 10 insertions, 1 deletions
diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog
index a26a35a..6b0000a 100644
--- a/sim/bfin/ChangeLog
+++ b/sim/bfin/ChangeLog
@@ -1,3 +1,10 @@
+2021-06-30 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sim_open): Set STATE_MACHS.
+ * machs.c (sim_machs): Rename to ...
+ (bfin_sim_machs): ... this.
+ * machs.h (bfin_sim_machs): New decl.
+
2021-06-29 Mike Frysinger <vapier@gentoo.org>
* machs.c (sim_machs): Mark const.
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index ddd0e7a..dcc7a13 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -703,6 +703,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
sizeof (struct bfin_board_data));
/* Set default options before parsing user options. */
+ STATE_MACHS (sd) = bfin_sim_machs;
current_alignment = STRICT_ALIGNMENT;
current_target_byte_order = BFD_ENDIAN_LITTLE;
diff --git a/sim/bfin/machs.c b/sim/bfin/machs.c
index ff49bb7..a6f7033 100644
--- a/sim/bfin/machs.c
+++ b/sim/bfin/machs.c
@@ -1962,7 +1962,7 @@ static const SIM_MACH bfin_mach =
bfin_prepare_run
};
-const SIM_MACH * const sim_machs[] =
+const SIM_MACH * const bfin_sim_machs[] =
{
& bfin_mach,
NULL
diff --git a/sim/bfin/machs.h b/sim/bfin/machs.h
index 105f50c..55c260a 100644
--- a/sim/bfin/machs.h
+++ b/sim/bfin/machs.h
@@ -32,6 +32,7 @@ struct bfin_board_data {
void bfin_model_cpu_init (SIM_DESC, SIM_CPU *);
bu32 bfin_model_get_chipid (SIM_DESC);
bu32 bfin_model_get_dspid (SIM_DESC);
+extern const SIM_MACH * const bfin_sim_machs[];
#define BFIN_COREMMR_CEC_BASE 0xFFE02100
#define BFIN_COREMMR_CEC_SIZE (4 * 5)