forked from Imagelibrary/binutils-gdb
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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user