diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-12-25 04:27:27 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-12-25 04:40:31 -0500 |
commit | 0d58595077841917ad57c9f8d2a61184a504ef40 (patch) | |
tree | 700d848c63f82b4284abebb23b1689a2272eb108 /sim/common/sim-model.c | |
parent | 8a0ebee658862bec66191df192c1d3b09bf0c943 (diff) | |
download | binutils-0d58595077841917ad57c9f8d2a61184a504ef40.zip binutils-0d58595077841917ad57c9f8d2a61184a504ef40.tar.gz binutils-0d58595077841917ad57c9f8d2a61184a504ef40.tar.bz2 |
sim: sim-model: build for everyone
Rather than include this for some targets, set it up so we can build it
all the time via the common code. This makes it easier for targets to
opt into it when they're ready, increases build coverage, and allows us
to centralize much of the logic.
We also get to delete tconfig.h from two more targets -- they were
setting WITH_DEVICES to 0 which has the same behavior as not defining
it at all.
While the SIM_HAVE_MODEL knob is gone, we now have WITH_MODEL_P, but it
is only used by the common sim-model code. We use it to declare dummy
model lists when the arch hasn't created its own.
Diffstat (limited to 'sim/common/sim-model.c')
-rw-r--r-- | sim/common/sim-model.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sim/common/sim-model.c b/sim/common/sim-model.c index 0d0c28d..054f0bc 100644 --- a/sim/common/sim-model.c +++ b/sim/common/sim-model.c @@ -190,6 +190,9 @@ 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 @@ -241,3 +244,12 @@ sim_model_init (SIM_DESC sd) return SIM_RC_OK; } + +#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 *sim_machs[] = +{ + NULL +}; +#endif |