aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-model.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-12-25 04:27:27 -0500
committerMike Frysinger <vapier@gentoo.org>2015-12-25 04:40:31 -0500
commit0d58595077841917ad57c9f8d2a61184a504ef40 (patch)
tree700d848c63f82b4284abebb23b1689a2272eb108 /sim/common/sim-model.h
parent8a0ebee658862bec66191df192c1d3b09bf0c943 (diff)
downloadgdb-0d58595077841917ad57c9f8d2a61184a504ef40.zip
gdb-0d58595077841917ad57c9f8d2a61184a504ef40.tar.gz
gdb-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.h')
-rw-r--r--sim/common/sim-model.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sim/common/sim-model.h b/sim/common/sim-model.h
index 5baa5ce..a206626 100644
--- a/sim/common/sim-model.h
+++ b/sim/common/sim-model.h
@@ -21,6 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
architecture = one of sparc, mips, sh, etc.
in the sparc architecture, mach = one of v6, v7, v8, sparclite, etc.
in the v8 mach, model = one of supersparc, etc.
+
+ To use the model framework, your arch needs to do a few things:
+ (1) Call SIM_AC_OPTION_DEFAULT_MODEL() in configure.ac.
+ (2) Define enum mach_attr in sim-main.h.
+ (3) Define sim_machs array (and all the callbacks it uses).
*/
/* This file is intended to be included by sim-basics.h. */
@@ -42,6 +47,15 @@ typedef struct {
#define MAX_UNITS 1
#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
+# define WITH_MODEL_P 1
+#endif
+
typedef int (MODEL_FN) (sim_cpu *, void *);
typedef struct {