aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-model.h
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/common/sim-model.h
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/common/sim-model.h')
-rw-r--r--sim/common/sim-model.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/sim/common/sim-model.h b/sim/common/sim-model.h
index d6edf64..e735feb 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 */