public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: namespace sim_machs
@ 2021-06-30  2:49 Mike Frysinger
  2021-06-30  3:23 ` [PATCH] sim: move default model to the runtime sim state Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30  2:49 UTC (permalink / raw)
  To: gdb-patches

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.
---
 sim/bfin/interp.c       |  1 +
 sim/bfin/machs.c        |  2 +-
 sim/bfin/machs.h        |  1 +
 sim/bpf/arch.c          |  2 +-
 sim/bpf/sim-if.c        |  5 +++++
 sim/common/cgen-defs.h  |  2 +-
 sim/common/cgen-utils.c | 10 +++++----
 sim/common/sim-base.h   |  4 ++++
 sim/common/sim-cpu.c    |  2 +-
 sim/common/sim-model.c  | 46 ++++++++++++++++++++++++-----------------
 sim/common/sim-model.h  | 16 ++++----------
 sim/cris/arch.c         |  2 +-
 sim/cris/sim-if.c       |  3 +++
 sim/frv/arch.c          |  2 +-
 sim/frv/sim-if.c        |  3 +++
 sim/iq2000/arch.c       |  2 +-
 sim/iq2000/sim-if.c     |  3 +++
 sim/lm32/arch.c         |  2 +-
 sim/lm32/sim-if.c       |  3 +++
 sim/m32r/arch.c         |  2 +-
 sim/m32r/sim-if.c       |  3 +++
 sim/or1k/arch.c         |  2 +-
 sim/or1k/sim-if.c       |  3 +++
 sim/riscv/interp.c      |  3 +++
 sim/riscv/machs.c       |  2 +-
 25 files changed, 80 insertions(+), 46 deletions(-)

diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index ddd0e7a372e8..dcc7a132d765 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 ff49bb7c3bb0..a6f7033a1aef 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 105f50c160b9..55c260a15b55 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)
diff --git a/sim/bpf/arch.c b/sim/bpf/arch.c
index 8ceaa34cef83..c9f98c5962db 100644
--- a/sim/bpf/arch.c
+++ b/sim/bpf/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 bpf_sim_machs[] =
 {
 #ifdef HAVE_CPU_BPFBF
   & bpf_mach,
diff --git a/sim/bpf/sim-if.c b/sim/bpf/sim-if.c
index 436cc86f415d..150f5cd67861 100644
--- a/sim/bpf/sim-if.c
+++ b/sim/bpf/sim-if.c
@@ -111,6 +111,8 @@ bpf_free_state (SIM_DESC sd)
   sim_state_free (sd);
 }
 
+extern const SIM_MACH * const bpf_sim_machs[];
+
 /* Create an instance of the simulator.  */
 
 SIM_DESC
@@ -125,6 +127,9 @@ sim_open (SIM_OPEN_KIND kind,
 
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
+  /* Set default options before parsing user options.  */
+  STATE_MACHS (sd) = bpf_sim_machs;
+
   if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     goto error;
 
diff --git a/sim/common/cgen-defs.h b/sim/common/cgen-defs.h
index 520c29cb3b9f..b6ed2ee3a205 100644
--- a/sim/common/cgen-defs.h
+++ b/sim/common/cgen-defs.h
@@ -146,7 +146,7 @@ extern CPU_INSN_NAME_FN cgen_insn_name;
 /* Return the maximum number of extra bytes required for a sim_cpu struct.  */
 /* ??? Ok, yes, this is less pretty than it should be.  Give me a better
    language [or suggest a better way].  */
-extern int cgen_cpu_max_extra_bytes (void);
+extern int cgen_cpu_max_extra_bytes (SIM_DESC);
 
 /* Target supplied routine to process an invalid instruction.  */
 extern SEM_PC sim_engine_invalid_insn (SIM_CPU *, IADDR, SEM_PC);
diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c
index 8c0856c795b8..d9c3ea9aa804 100644
--- a/sim/common/cgen-utils.c
+++ b/sim/common/cgen-utils.c
@@ -101,14 +101,16 @@ cgen_insn_name (SIM_CPU *cpu, int i)
 /* Return the maximum number of extra bytes required for a SIM_CPU struct.  */
 
 int
-cgen_cpu_max_extra_bytes (void)
+cgen_cpu_max_extra_bytes (SIM_DESC sd)
 {
-  int i;
+  const SIM_MACH * const *machp;
   int extra = 0;
 
-  for (i = 0; sim_machs[i] != 0; ++i)
+  SIM_ASSERT (STATE_MACHS (sd) != NULL);
+
+  for (machp = STATE_MACHS (sd); *machp != NULL; ++machp)
     {
-      int size = IMP_PROPS_SIM_CPU_SIZE (MACH_IMP_PROPS (sim_machs[i]));
+      int size = IMP_PROPS_SIM_CPU_SIZE (MACH_IMP_PROPS (*machp));
       if (size > extra)
 	extra = size;
     }
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index 054b2ba0c6eb..c32a200b36aa 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -143,6 +143,10 @@ struct sim_state {
   const char *target;
 #define STATE_TARGET(sd) ((sd)->target)
 
+  /* List of maches available.  */
+  const SIM_MACH * const *machs;
+#define STATE_MACHS(sd) ((sd)->machs)
+
   /* In standalone simulator, this is the program's arguments passed
      on the command line.  */
   char **prog_argv;
diff --git a/sim/common/sim-cpu.c b/sim/common/sim-cpu.c
index 587a3e8c9e1c..bde3e617ce31 100644
--- a/sim/common/sim-cpu.c
+++ b/sim/common/sim-cpu.c
@@ -48,7 +48,7 @@ sim_cpu_alloc (SIM_DESC sd)
   int extra_bytes = 0;
 
 #ifdef CGEN_ARCH
-  extra_bytes += cgen_cpu_max_extra_bytes ();
+  extra_bytes += cgen_cpu_max_extra_bytes (sd);
 #endif
 
   return zalloc (sizeof (sim_cpu) + extra_bytes);
diff --git a/sim/common/sim-model.c b/sim/common/sim-model.c
index bfdb3c24bc8b..4c5e463f1a07 100644
--- a/sim/common/sim-model.c
+++ b/sim/common/sim-model.c
@@ -62,7 +62,7 @@ model_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
     {
     case OPTION_MODEL :
       {
-	const SIM_MODEL *model = sim_model_lookup (arg);
+	const SIM_MODEL *model = sim_model_lookup (sd, arg);
 	if (! model)
 	  {
 	    sim_io_eprintf (sd, "unknown model `%s'\n", arg);
@@ -76,7 +76,14 @@ model_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
       {
 	const SIM_MACH * const *machp;
 	const SIM_MODEL *model;
-	for (machp = & sim_machs[0]; *machp != NULL; ++machp)
+
+	if (STATE_MACHS (sd) == NULL)
+	  {
+	    sim_io_printf (sd, "This target does not support any models\n");
+	    return SIM_RC_FAIL;
+	  }
+
+	for (machp = STATE_MACHS(sd); *machp != NULL; ++machp)
 	  {
 	    sim_io_printf (sd, "Models for architecture `%s':\n",
 			   MACH_NAME (*machp));
@@ -138,12 +145,15 @@ sim_model_set (SIM_DESC sd, sim_cpu *cpu, const SIM_MODEL *model)
    Result is pointer to MODEL entry or NULL if not found.  */
 
 const SIM_MODEL *
-sim_model_lookup (const char *name)
+sim_model_lookup (SIM_DESC sd, const char *name)
 {
   const SIM_MACH * const *machp;
   const SIM_MODEL *model;
 
-  for (machp = & sim_machs[0]; *machp != NULL; ++machp)
+  if (STATE_MACHS (sd) == NULL)
+    return NULL;
+
+  for (machp = STATE_MACHS (sd); *machp != NULL; ++machp)
     {
       for (model = MACH_MODELS (*machp); MODEL_NAME (model) != NULL; ++model)
 	{
@@ -158,11 +168,14 @@ sim_model_lookup (const char *name)
    Result is pointer to MACH entry or NULL if not found.  */
 
 const SIM_MACH *
-sim_mach_lookup (const char *name)
+sim_mach_lookup (SIM_DESC sd, const char *name)
 {
   const SIM_MACH * const *machp;
 
-  for (machp = & sim_machs[0]; *machp != NULL; ++machp)
+  if (STATE_MACHS (sd) == NULL)
+    return NULL;
+
+  for (machp = STATE_MACHS (sd); *machp != NULL; ++machp)
     {
       if (strcmp (MACH_NAME (*machp), name) == 0)
 	return *machp;
@@ -174,11 +187,14 @@ sim_mach_lookup (const char *name)
    Result is pointer to MACH entry or NULL if not found.  */
 
 const SIM_MACH *
-sim_mach_lookup_bfd_name (const char *name)
+sim_mach_lookup_bfd_name (SIM_DESC sd, const char *name)
 {
   const SIM_MACH * const *machp;
 
-  for (machp = & sim_machs[0]; *machp != NULL; ++machp)
+  if (STATE_MACHS (sd) == NULL)
+    return NULL;
+
+  for (machp = STATE_MACHS (sd); *machp != NULL; ++machp)
     {
       if (strcmp (MACH_BFD_NAME (*machp), name) == 0)
 	return *machp;
@@ -209,7 +225,7 @@ sim_model_init (SIM_DESC sd)
       && ! CPU_MACH (cpu))
     {
       /* Set the default model.  */
-      const SIM_MODEL *model = sim_model_lookup (WITH_DEFAULT_MODEL);
+      const SIM_MODEL *model = sim_model_lookup (sd, WITH_DEFAULT_MODEL);
       SIM_ASSERT (model != NULL);
       sim_model_set (sd, NULL, model);
     }
@@ -230,7 +246,8 @@ sim_model_init (SIM_DESC sd)
     {
       /* Use the default model for the selected machine.
 	 The default model is the first one in the list.  */
-      const SIM_MACH *mach = sim_mach_lookup_bfd_name (STATE_ARCHITECTURE (sd)->printable_name);
+      const SIM_MACH *mach =
+	sim_mach_lookup_bfd_name (sd, STATE_ARCHITECTURE (sd)->printable_name);
 
       if (mach == NULL)
 	{
@@ -247,12 +264,3 @@ sim_model_init (SIM_DESC sd)
 
   return SIM_RC_OK;
 }
-\f
-#if !WITH_MODEL_P
-/* Set up basic model support.  This is a stub for ports that do not define
-   models.  See sim-model.h for more details.  */
-const SIM_MACH * const sim_machs[] =
-{
-  NULL
-};
-#endif
diff --git a/sim/common/sim-model.h b/sim/common/sim-model.h
index d6edf649d6e2..e735feb4b9ad 100644
--- a/sim/common/sim-model.h
+++ b/sim/common/sim-model.h
@@ -48,8 +48,6 @@ typedef struct {
 #endif
 
 #ifndef WITH_DEFAULT_MODEL
-/* Just a stub for ports that do not define models.  */
-enum mach_attr { _MACH_NONE };
 # define WITH_DEFAULT_MODEL NULL
 # define WITH_MODEL_P 0
 #else
@@ -92,7 +90,7 @@ typedef struct {
   /* This is the argument to bfd_scan_arch.  */
   const char *bfd_name;
 #define MACH_BFD_NAME(m) ((m)->bfd_name)
-  enum mach_attr num;
+  int num;
 #define MACH_NUM(m) ((m)->num)
 
   int word_bitsize;
@@ -136,19 +134,13 @@ typedef struct model {
 #define MODEL_INIT(m) ((m)->init)
 } SIM_MODEL;
 
-/* Tables of supported machines.  */
-/* ??? In a simulator of multiple architectures, will need multiple copies of
-   this.  Have an `archs' array that contains a pointer to the machs array
-   for each (which in turn has a pointer to the models array for each).  */
-extern const SIM_MACH * const sim_machs[];
-
 /* Model module handlers.  */
 extern MODULE_INSTALL_FN sim_model_install;
 
 /* Support routines.  */
 extern void sim_model_set (SIM_DESC sd_, sim_cpu *cpu_, const SIM_MODEL *model_);
-extern const SIM_MODEL *sim_model_lookup (const char *name_);
-extern const SIM_MACH *sim_mach_lookup (const char *name_);
-extern const SIM_MACH *sim_mach_lookup_bfd_name (const char *bfd_name_);
+extern const SIM_MODEL *sim_model_lookup (SIM_DESC, const char *name_);
+extern const SIM_MACH *sim_mach_lookup (SIM_DESC, const char *name_);
+extern const SIM_MACH *sim_mach_lookup_bfd_name (SIM_DESC, const char *bfd_name_);
 
 #endif /* SIM_MODEL_H */
diff --git a/sim/cris/arch.c b/sim/cris/arch.c
index 1635ef6a9557..cd83edeaaedc 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 992493935212..37a1d5b558a0 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.  */
diff --git a/sim/frv/arch.c b/sim/frv/arch.c
index f58ed1168162..db18ec4d7277 100644
--- a/sim/frv/arch.c
+++ b/sim/frv/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 frv_sim_machs[] =
 {
 #ifdef HAVE_CPU_FRVBF
   & frv_mach,
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index 530a8dd04289..82f4bd845f5d 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -42,6 +42,8 @@ free_state (SIM_DESC sd)
   sim_state_free (sd);
 }
 
+extern const SIM_MACH * const frv_sim_machs[];
+
 /* Create an instance of the simulator.  */
 
 SIM_DESC
@@ -54,6 +56,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, bfd *abfd,
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* Set default options before parsing user options.  */
+  STATE_MACHS (sd) = frv_sim_machs;
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/iq2000/arch.c b/sim/iq2000/arch.c
index 22dc565b1bca..523dfe1bc005 100644
--- a/sim/iq2000/arch.c
+++ b/sim/iq2000/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 iq2000_sim_machs[] =
 {
 #ifdef HAVE_CPU_IQ2000BF
   & iq2000_mach,
diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c
index 1129cee91457..6df4b944300e 100644
--- a/sim/iq2000/sim-if.c
+++ b/sim/iq2000/sim-if.c
@@ -50,6 +50,8 @@ free_state (SIM_DESC sd)
   sim_state_free (sd);
 }
 
+extern const SIM_MACH * const iq2000_sim_machs[];
+
 /* Create an instance of the simulator.  */
 
 SIM_DESC
@@ -61,6 +63,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
   SIM_DESC sd = sim_state_alloc (kind, callback);
 
   /* Set default options before parsing user options.  */
+  STATE_MACHS (sd) = iq2000_sim_machs;
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/lm32/arch.c b/sim/lm32/arch.c
index 72fe4b43b87b..4c485140fdb7 100644
--- a/sim/lm32/arch.c
+++ b/sim/lm32/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 lm32_sim_machs[] =
 {
 #ifdef HAVE_CPU_LM32BF
   & lm32_mach,
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index 0142868834d5..abb9ad7b042c 100644
--- a/sim/lm32/sim-if.c
+++ b/sim/lm32/sim-if.c
@@ -80,6 +80,8 @@ find_limit (SIM_DESC sd)
   return (addr + 65536) & ~(0xffffUL);
 }
 
+extern const SIM_MACH * const lm32_sim_machs[];
+
 /* Create an instance of the simulator.  */
 
 SIM_DESC
@@ -92,6 +94,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
   unsigned long base, limit;
 
   /* Set default options before parsing user options.  */
+  STATE_MACHS (sd) = lm32_sim_machs;
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/m32r/arch.c b/sim/m32r/arch.c
index 4b789759eb65..b25cd3f990cc 100644
--- a/sim/m32r/arch.c
+++ b/sim/m32r/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 m32r_sim_machs[] =
 {
 #ifdef HAVE_CPU_M32RBF
   & m32r_mach,
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c
index 3d8db0332fd6..33ae7c106e39 100644
--- a/sim/m32r/sim-if.c
+++ b/sim/m32r/sim-if.c
@@ -44,6 +44,8 @@ free_state (SIM_DESC sd)
   sim_state_free (sd);
 }
 
+extern const SIM_MACH * const m32r_sim_machs[];
+
 /* Create an instance of the simulator.  */
 
 SIM_DESC
@@ -55,6 +57,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) = m32r_sim_machs;
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/or1k/arch.c b/sim/or1k/arch.c
index ef3c403c9435..87b37249fb31 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 06d7dcb61b23..e8353887c828 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.  */
diff --git a/sim/riscv/interp.c b/sim/riscv/interp.c
index 8b96677634f9..8908ed12ae87 100644
--- a/sim/riscv/interp.c
+++ b/sim/riscv/interp.c
@@ -53,6 +53,8 @@ free_state (SIM_DESC sd)
   sim_state_free (sd);
 }
 
+extern const SIM_MACH * const riscv_sim_machs[];
+
 SIM_DESC
 sim_open (SIM_OPEN_KIND kind, host_callback *callback,
 	  struct bfd *abfd, char * const *argv)
@@ -63,6 +65,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
 				       sizeof (struct riscv_sim_state));
 
   /* Set default options before parsing user options.  */
+  STATE_MACHS (sd) = riscv_sim_machs;
   current_target_byte_order = BFD_ENDIAN_LITTLE;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
diff --git a/sim/riscv/machs.c b/sim/riscv/machs.c
index eb75a1dd2002..339e5ba4754d 100644
--- a/sim/riscv/machs.c
+++ b/sim/riscv/machs.c
@@ -111,7 +111,7 @@ static const SIM_MACH rv128i_mach =
 #endif
 
 /* Order matters here.  */
-const SIM_MACH * const sim_machs[] =
+const SIM_MACH * const riscv_sim_machs[] =
 {
 #if WITH_TARGET_WORD_BITSIZE >= 128
   &rv128i_mach,
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] sim: move default model to the runtime sim state
  2021-06-30  2:49 [PATCH] sim: namespace sim_machs Mike Frysinger
@ 2021-06-30  3:23 ` Mike Frysinger
  2021-06-30  3:26 ` [PATCH] sim: delete unused model settings Mike Frysinger
  2021-06-30  3:32 ` [PATCH] sim: bfin: merge with common configure script Mike Frysinger
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30  3:23 UTC (permalink / raw)
  To: gdb-patches

This kills off another compile-time option by moving the setting to
the individual arch runtimes.  This will allow dynamic selection by
the arch when doing a single build with multiple arches.

The sim_model_init rework is a little funky.  In the past it was
disabled entirely if no default model was set.  We maintain the
spirit of the logic by gating the fallback logic on whether the
port has defined any models.
---
 sim/Makefile.in                       |  1 -
 sim/bfin/aclocal.m4                   |  1 -
 sim/bfin/configure                    | 29 +------------------------
 sim/bfin/configure.ac                 |  2 --
 sim/bfin/interp.c                     |  1 +
 sim/bpf/aclocal.m4                    |  1 -
 sim/bpf/configure                     | 21 ------------------
 sim/bpf/configure.ac                  |  1 -
 sim/bpf/sim-if.c                      |  1 +
 sim/common/Make-common.in             |  2 --
 sim/common/sim-base.h                 |  4 ++++
 sim/common/sim-model.c                | 13 ++++++-----
 sim/common/sim-model.h                |  7 ------
 sim/configure                         |  6 ++----
 sim/configure.ac                      |  1 -
 sim/cris/aclocal.m4                   |  1 -
 sim/cris/configure                    | 25 +--------------------
 sim/cris/configure.ac                 |  3 ---
 sim/cris/sim-if.c                     |  1 +
 sim/frv/aclocal.m4                    |  1 -
 sim/frv/configure                     | 23 +-------------------
 sim/frv/configure.ac                  |  1 -
 sim/frv/sim-if.c                      |  1 +
 sim/iq2000/aclocal.m4                 |  1 -
 sim/iq2000/configure                  | 23 +-------------------
 sim/iq2000/configure.ac               |  1 -
 sim/iq2000/sim-if.c                   |  1 +
 sim/lm32/aclocal.m4                   |  1 -
 sim/lm32/configure                    | 23 +-------------------
 sim/lm32/configure.ac                 |  1 -
 sim/lm32/sim-if.c                     |  1 +
 sim/m32r/aclocal.m4                   |  1 -
 sim/m32r/configure                    | 23 +-------------------
 sim/m32r/configure.ac                 |  1 -
 sim/m32r/sim-if.c                     |  1 +
 sim/m4/sim_ac_option_default_model.m4 | 31 ---------------------------
 sim/m4/sim_ac_output.m4               |  1 -
 sim/mips/configure                    |  2 --
 sim/mn10300/configure                 |  2 --
 sim/or1k/aclocal.m4                   |  1 -
 sim/or1k/configure                    | 21 ------------------
 sim/or1k/configure.ac                 |  1 -
 sim/or1k/sim-if.c                     |  1 +
 sim/riscv/aclocal.m4                  |  1 -
 sim/riscv/configure                   | 28 ------------------------
 sim/riscv/configure.ac                |  8 -------
 sim/riscv/interp.c                    |  1 +
 sim/v850/configure                    |  2 --
 48 files changed, 27 insertions(+), 298 deletions(-)
 delete mode 100644 sim/m4/sim_ac_option_default_model.m4

diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac
index 6cf5c4879584..99370b3a5770 100644
--- a/sim/bfin/configure.ac
+++ b/sim/bfin/configure.ac
@@ -2,6 +2,4 @@ dnl Process this file with autoconf to produce a configure script.
 AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
-SIM_AC_OPTION_DEFAULT_MODEL(bf537)
-
 SIM_AC_OUTPUT
diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c
index dcc7a132d765..b99f20d91696 100644
--- a/sim/bfin/interp.c
+++ b/sim/bfin/interp.c
@@ -704,6 +704,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = bfin_sim_machs;
+  STATE_MODEL_NAME (sd) = "bf537";
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_LITTLE;
 
diff --git a/sim/bpf/configure.ac b/sim/bpf/configure.ac
index 32729370b5aa..9cbd202d590d 100644
--- a/sim/bpf/configure.ac
+++ b/sim/bpf/configure.ac
@@ -4,6 +4,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_BITSIZE([64])
 SIM_AC_OPTION_SCACHE(16384)
-SIM_AC_OPTION_DEFAULT_MODEL([bpf-def])
 
 SIM_AC_OUTPUT
diff --git a/sim/bpf/sim-if.c b/sim/bpf/sim-if.c
index 150f5cd67861..aba191df7ec4 100644
--- a/sim/bpf/sim-if.c
+++ b/sim/bpf/sim-if.c
@@ -129,6 +129,7 @@ sim_open (SIM_OPEN_KIND kind,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = bpf_sim_machs;
+  STATE_MODEL_NAME (sd) = "bpf-def";
 
   if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
     goto error;
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 723bda589c9b..992fd7f8a6ef 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -73,7 +73,6 @@ top_builddir = ..
 SHELL = @SHELL@
 
 SIM_BITSIZE = @sim_bitsize@
-SIM_DEFAULT_MODEL = @sim_default_model@
 SIM_FLOAT = @sim_float@
 SIM_RESERVED_BITS = @sim_reserved_bits@
 SIM_SCACHE = @sim_scache@
@@ -195,7 +194,6 @@ CGEN_INCLUDE_DEPS = \
 
 CONFIG_CFLAGS = \
 	-DHAVE_CONFIG_H \
-	$(SIM_DEFAULT_MODEL) \
 	$(SIM_BITSIZE) \
 	$(SIM_FLOAT) \
 	$(SIM_HW_CFLAGS) \
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index c32a200b36aa..47abbe1ee86b 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -147,6 +147,10 @@ struct sim_state {
   const SIM_MACH * const *machs;
 #define STATE_MACHS(sd) ((sd)->machs)
 
+  /* If non-NULL, the model to select for CPUs.  */
+  const char *model_name;
+#define STATE_MODEL_NAME(sd) ((sd)->model_name)
+
   /* In standalone simulator, this is the program's arguments passed
      on the command line.  */
   char **prog_argv;
diff --git a/sim/common/sim-model.c b/sim/common/sim-model.c
index 4c5e463f1a07..98dcbeae6cc1 100644
--- a/sim/common/sim-model.c
+++ b/sim/common/sim-model.c
@@ -68,6 +68,7 @@ model_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
 	    sim_io_eprintf (sd, "unknown model `%s'\n", arg);
 	    return SIM_RC_FAIL;
 	  }
+	STATE_MODEL_NAME (sd) = arg;
 	sim_model_set (sd, cpu, model);
 	break;
       }
@@ -209,9 +210,6 @@ sim_model_init (SIM_DESC sd)
 {
   SIM_CPU *cpu;
 
-  if (!WITH_MODEL_P)
-    return SIM_RC_OK;
-
   /* If both cpu model and state architecture are set, ensure they're
      compatible.  If only one is set, set the other.  If neither are set,
      use the default model.  STATE_ARCHITECTURE is the bfd_arch_info data
@@ -222,10 +220,11 @@ sim_model_init (SIM_DESC sd)
   cpu = STATE_CPU (sd, 0);
 
   if (! STATE_ARCHITECTURE (sd)
-      && ! CPU_MACH (cpu))
+      && ! CPU_MACH (cpu)
+      && STATE_MODEL_NAME (sd))
     {
       /* Set the default model.  */
-      const SIM_MODEL *model = sim_model_lookup (sd, WITH_DEFAULT_MODEL);
+      const SIM_MODEL *model = sim_model_lookup (sd, STATE_MODEL_NAME (sd));
       SIM_ASSERT (model != NULL);
       sim_model_set (sd, NULL, model);
     }
@@ -242,7 +241,7 @@ sim_model_init (SIM_DESC sd)
 	  return SIM_RC_FAIL;
 	}
     }
-  else if (STATE_ARCHITECTURE (sd))
+  else if (STATE_ARCHITECTURE (sd) && STATE_MACHS (sd))
     {
       /* Use the default model for the selected machine.
 	 The default model is the first one in the list.  */
@@ -257,7 +256,7 @@ sim_model_init (SIM_DESC sd)
 	}
       sim_model_set (sd, NULL, MACH_MODELS (mach));
     }
-  else
+  else if (CPU_MACH (cpu))
     {
       STATE_ARCHITECTURE (sd) = bfd_scan_arch (MACH_BFD_NAME (CPU_MACH (cpu)));
     }
diff --git a/sim/common/sim-model.h b/sim/common/sim-model.h
index e735feb4b9ad..ecef2571766e 100644
--- a/sim/common/sim-model.h
+++ b/sim/common/sim-model.h
@@ -47,13 +47,6 @@ typedef struct {
 #define MAX_UNITS 1
 #endif
 
-#ifndef WITH_DEFAULT_MODEL
-# define WITH_DEFAULT_MODEL NULL
-# define WITH_MODEL_P 0
-#else
-# define WITH_MODEL_P 1
-#endif
-
 typedef int (MODEL_FN) (sim_cpu *, void *);
 
 typedef struct {
diff --git a/sim/configure.ac b/sim/configure.ac
index 15b2b65c87e8..0b31d2c5eefa 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -172,7 +172,6 @@ dnl respective SIM_AC_OPTION_xxx call above, we can drop these.
 AC_SUBST(sim_bitsize)
 AC_SUBST(sim_float)
 AC_SUBST(sim_scache)
-AC_SUBST(sim_default_model)
 AC_SUBST(sim_reserved_bits)
 
 dnl Some arches have unique configure flags.
diff --git a/sim/cris/configure.ac b/sim/cris/configure.ac
index 57a2d5fe3d7a..d2037221bfee 100644
--- a/sim/cris/configure.ac
+++ b/sim/cris/configure.ac
@@ -4,7 +4,4 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_SCACHE(16384)
 
-# The default model shouldn't matter as long as there's a BFD.
-SIM_AC_OPTION_DEFAULT_MODEL(crisv32)
-
 SIM_AC_OUTPUT
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index 37a1d5b558a0..2d7e9221505a 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -659,6 +659,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = cris_sim_machs;
+  STATE_MODEL_NAME (sd) = "crisv32";
   current_target_byte_order = BFD_ENDIAN_LITTLE;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
diff --git a/sim/frv/configure.ac b/sim/frv/configure.ac
index 83ad0112844d..785a3bc1cc23 100644
--- a/sim/frv/configure.ac
+++ b/sim/frv/configure.ac
@@ -3,7 +3,6 @@ AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_SCACHE(16384)
-SIM_AC_OPTION_DEFAULT_MODEL(fr500)
 
 #
 # Enable making unknown traps dump out registers
diff --git a/sim/frv/sim-if.c b/sim/frv/sim-if.c
index 82f4bd845f5d..6d22aaddc090 100644
--- a/sim/frv/sim-if.c
+++ b/sim/frv/sim-if.c
@@ -57,6 +57,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, bfd *abfd,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = frv_sim_machs;
+  STATE_MODEL_NAME (sd) = "fr500";
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/iq2000/configure.ac b/sim/iq2000/configure.ac
index e35068f31f8c..d2037221bfee 100644
--- a/sim/iq2000/configure.ac
+++ b/sim/iq2000/configure.ac
@@ -3,6 +3,5 @@ AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_SCACHE(16384)
-SIM_AC_OPTION_DEFAULT_MODEL(iq2000)
 
 SIM_AC_OUTPUT
diff --git a/sim/iq2000/sim-if.c b/sim/iq2000/sim-if.c
index 6df4b944300e..9728882dac51 100644
--- a/sim/iq2000/sim-if.c
+++ b/sim/iq2000/sim-if.c
@@ -64,6 +64,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = iq2000_sim_machs;
+  STATE_MODEL_NAME (sd) = "iq2000";
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/lm32/configure.ac b/sim/lm32/configure.ac
index 96b6f0e98e25..d2037221bfee 100644
--- a/sim/lm32/configure.ac
+++ b/sim/lm32/configure.ac
@@ -3,6 +3,5 @@ AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_SCACHE(16384)
-SIM_AC_OPTION_DEFAULT_MODEL(lm32)
 
 SIM_AC_OUTPUT
diff --git a/sim/lm32/sim-if.c b/sim/lm32/sim-if.c
index abb9ad7b042c..f9143ea00375 100644
--- a/sim/lm32/sim-if.c
+++ b/sim/lm32/sim-if.c
@@ -95,6 +95,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = lm32_sim_machs;
+  STATE_MODEL_NAME (sd) = "lm32";
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/m32r/configure.ac b/sim/m32r/configure.ac
index f98adb26c46d..eed2e91c87a7 100644
--- a/sim/m32r/configure.ac
+++ b/sim/m32r/configure.ac
@@ -3,7 +3,6 @@ AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_SCACHE(16384)
-SIM_AC_OPTION_DEFAULT_MODEL(m32r/d)
 
   case "${target_alias}" in
   m32r*-linux*)
diff --git a/sim/m32r/sim-if.c b/sim/m32r/sim-if.c
index 33ae7c106e39..8957e83bf334 100644
--- a/sim/m32r/sim-if.c
+++ b/sim/m32r/sim-if.c
@@ -58,6 +58,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = m32r_sim_machs;
+  STATE_MODEL_NAME (sd) = "m32r/d";
   current_alignment = STRICT_ALIGNMENT;
   current_target_byte_order = BFD_ENDIAN_BIG;
 
diff --git a/sim/m4/sim_ac_option_default_model.m4 b/sim/m4/sim_ac_option_default_model.m4
deleted file mode 100644
index 115093734bc6..000000000000
--- a/sim/m4/sim_ac_option_default_model.m4
+++ /dev/null
@@ -1,31 +0,0 @@
-dnl   Copyright (C) 1997-2021 Free Software Foundation, Inc.
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 3 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
-dnl
-dnl The argument is the default model if none is specified.
-AC_DEFUN([SIM_AC_OPTION_DEFAULT_MODEL],
-[
-default_sim_default_model="ifelse([$1],,0,[$1])"
-AC_ARG_ENABLE(sim-default-model,
-[AS_HELP_STRING([--enable-sim-default-model=model],
-		[Specify default model to simulate])],
-[case "${enableval}" in
-  yes|no) AC_MSG_ERROR("Missing argument to --enable-sim-default-model");;
-  *)	sim_default_model="-DWITH_DEFAULT_MODEL='\"${enableval}\"'";;
-esac
-if test x"$silent" != x"yes" && test x"$sim_default_model" != x""; then
-  echo "Setting default model = $sim_default_model" 6>&1
-fi],[sim_default_model="-DWITH_DEFAULT_MODEL='\"${default_sim_default_model}\"'"])
-])
-AC_SUBST(sim_default_model)
diff --git a/sim/m4/sim_ac_output.m4 b/sim/m4/sim_ac_output.m4
index f9f70167e59c..100e2f9b4024 100644
--- a/sim/m4/sim_ac_output.m4
+++ b/sim/m4/sim_ac_output.m4
@@ -48,7 +48,6 @@ dnl when the rest of the code is in the respective macros.
 AC_SUBST(sim_bitsize)
 AC_SUBST(sim_float)
 AC_SUBST(sim_scache)
-AC_SUBST(sim_default_model)
 AC_SUBST(sim_reserved_bits)
 
 dnl Used by common/Make-common.in to see which configure script created it.
diff --git a/sim/or1k/configure.ac b/sim/or1k/configure.ac
index c72c80c5f47a..aaeb12135654 100644
--- a/sim/or1k/configure.ac
+++ b/sim/or1k/configure.ac
@@ -4,6 +4,5 @@ AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
 SIM_AC_OPTION_BITSIZE([32], [31], [32])
 SIM_AC_OPTION_SCACHE(16384)
-SIM_AC_OPTION_DEFAULT_MODEL([or1200])
 
 SIM_AC_OUTPUT
diff --git a/sim/or1k/sim-if.c b/sim/or1k/sim-if.c
index e8353887c828..3f47ce5e41b6 100644
--- a/sim/or1k/sim-if.c
+++ b/sim/or1k/sim-if.c
@@ -164,6 +164,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = or1k_sim_machs;
+  STATE_MODEL_NAME (sd) = "or1200";
   current_target_byte_order = BFD_ENDIAN_BIG;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
diff --git a/sim/riscv/configure.ac b/sim/riscv/configure.ac
index 01afe511ca8e..6edb28c863ed 100644
--- a/sim/riscv/configure.ac
+++ b/sim/riscv/configure.ac
@@ -2,14 +2,6 @@ dnl Process this file with autoconf to produce a configure script.
 AC_INIT(Makefile.in)
 AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
 
-# Select the default model for the target.
-riscv_model=
-case "${target}" in
-riscv32*) riscv_model="RV32G" ;;
-riscv*) riscv_model="RV64G" ;;
-esac
-SIM_AC_OPTION_DEFAULT_MODEL(${riscv_model})
-
 # Select the bitsize of the target.
 riscv_addr_bitsize=
 case "${target}" in
diff --git a/sim/riscv/interp.c b/sim/riscv/interp.c
index 8908ed12ae87..202412ab8ca0 100644
--- a/sim/riscv/interp.c
+++ b/sim/riscv/interp.c
@@ -66,6 +66,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
 
   /* Set default options before parsing user options.  */
   STATE_MACHS (sd) = riscv_sim_machs;
+  STATE_MODEL_NAME (sd) = WITH_TARGET_WORD_BITSIZE == 32 ? "RV32G" : "RV64G";
   current_target_byte_order = BFD_ENDIAN_LITTLE;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] sim: delete unused model settings
  2021-06-30  2:49 [PATCH] sim: namespace sim_machs Mike Frysinger
  2021-06-30  3:23 ` [PATCH] sim: move default model to the runtime sim state Mike Frysinger
@ 2021-06-30  3:26 ` Mike Frysinger
  2021-06-30  3:32 ` [PATCH] sim: bfin: merge with common configure script Mike Frysinger
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30  3:26 UTC (permalink / raw)
  To: gdb-patches

These were never fully migrated from the psim to common code, and since
we've finished moving the logic into the runtime sim state, we won't ever
need these.  So punt them.
---
 sim/common/sim-config.h | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/sim/common/sim-config.h b/sim/common/sim-config.h
index 5b1713cff706..aae08e71c585 100644
--- a/sim/common/sim-config.h
+++ b/sim/common/sim-config.h
@@ -252,29 +252,6 @@ extern int current_floating_point;
 					 | MONITOR_INSTRUCTION_ISSUE)
 
 
-/* Current CPU model (models are in the generated models.h include file)  */
-#ifndef WITH_MODEL
-#define WITH_MODEL			0
-#endif
-
-#define CURRENT_MODEL (WITH_MODEL	\
-		       ? WITH_MODEL	\
-		       : current_model)
-
-#define MODEL_ISSUE_IGNORE		(-1)
-#define MODEL_ISSUE_PROCESS		1
-
-#ifndef WITH_MODEL_ISSUE
-#define WITH_MODEL_ISSUE		0
-#endif
-
-extern int current_model_issue;
-#define CURRENT_MODEL_ISSUE (WITH_MODEL_ISSUE	\
-			     ? WITH_MODEL_ISSUE	\
-			     : current_model_issue)
-
-
-
 /* Whether or not input/output just uses stdio, or uses printf_filtered for
    output, and polling input for input.  */
 
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] sim: bfin: merge with common configure script
  2021-06-30  2:49 [PATCH] sim: namespace sim_machs Mike Frysinger
  2021-06-30  3:23 ` [PATCH] sim: move default model to the runtime sim state Mike Frysinger
  2021-06-30  3:26 ` [PATCH] sim: delete unused model settings Mike Frysinger
@ 2021-06-30  3:32 ` Mike Frysinger
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2021-06-30  3:32 UTC (permalink / raw)
  To: gdb-patches

Now that the model logic has been migrated into the runtime, there's
nothing specific in the bfin configure code, so merge it into the
common one.
---
 sim/Makefile.in       |   14 +-
 sim/bfin/aclocal.m4   |   15 -
 sim/bfin/configure    | 2878 -----------------------------------------
 sim/bfin/configure.ac |    5 -
 sim/configure         |   30 +-
 sim/configure.ac      |    2 +-
 6 files changed, 32 insertions(+), 2912 deletions(-)
 delete mode 100644 sim/bfin/aclocal.m4
 delete mode 100755 sim/bfin/configure
 delete mode 100644 sim/bfin/configure.ac

diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac
deleted file mode 100644
index 99370b3a5770..000000000000
--- a/sim/bfin/configure.ac
+++ /dev/null
@@ -1,5 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.in)
-AC_CONFIG_MACRO_DIRS([../m4 ../.. ../../config])
-
-SIM_AC_OUTPUT
diff --git a/sim/configure.ac b/sim/configure.ac
index 0b31d2c5eefa..c2a724b61386 100644
--- a/sim/configure.ac
+++ b/sim/configure.ac
@@ -114,7 +114,7 @@ if test "${enable_sim}" != no; then
     SIM_TARGET([aarch64*-*-*], [aarch64])
     SIM_TARGET([arm*-*-*], [arm])
     SIM_TARGET([avr*-*-*], [avr])
-    SIM_TARGET([bfin-*-*], [bfin], [true])
+    SIM_TARGET([bfin-*-*], [bfin])
     SIM_TARGET([bpf-*-*], [bpf], [true])
     SIM_TARGET([cr16*-*-*], [cr16])
     SIM_TARGET([cris-*-* | crisv32-*-*], [cris], [true])
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-30  3:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30  2:49 [PATCH] sim: namespace sim_machs Mike Frysinger
2021-06-30  3:23 ` [PATCH] sim: move default model to the runtime sim state Mike Frysinger
2021-06-30  3:26 ` [PATCH] sim: delete unused model settings Mike Frysinger
2021-06-30  3:32 ` [PATCH] sim: bfin: merge with common configure script Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).