1 /* Main header for the m32r. */
6 #define USING_SIM_BASE_H /* FIXME: quick hack */
8 struct _sim_cpu; /* FIXME: should be in sim-basics.h */
9 typedef struct _sim_cpu SIM_CPU;
12 #include "sim-basics.h"
13 #include "cgen-types.h"
14 #include "m32r-desc.h"
18 /* These must be defined before sim-base.h. */
21 #define CIA_GET(cpu) CPU_PC_GET (cpu)
22 #define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
24 #define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
26 if (cpu) /* null if ctrl-c */ \
27 sim_pc_set ((cpu), (cia)); \
29 #define SIM_ENGINE_RESTART_HOOK(sd, cpu, cia) \
31 sim_pc_set ((cpu), (cia)); \
37 #include "opcode/cgen.h"
39 /* The _sim_cpu struct. */
42 /* sim/common cpu base. */
45 /* Static parts of cgen. */
48 M32R_MISC_PROFILE m32r_misc_profile;
49 #define CPU_M32R_MISC_PROFILE(cpu) (& (cpu)->m32r_misc_profile)
51 /* CPU specific parts go here.
52 Note that in files that don't need to access these pieces WANT_CPU_FOO
53 won't be defined and thus these parts won't appear. This is ok in the
54 sense that things work. It is a source of bugs though.
55 One has to of course be careful to not take the size of this
56 struct and no structure members accessed in non-cpu specific files can
57 go after here. Oh for a better language. */
58 #if defined (WANT_CPU_M32RBF)
59 M32RBF_CPU_DATA cpu_data;
61 #if defined (WANT_CPU_M32RXF)
62 M32RXF_CPU_DATA cpu_data;
63 #elif defined (WANT_CPU_M32R2F)
64 M32R2F_CPU_DATA cpu_data;
68 /* The sim_state struct. */
72 #define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
74 CGEN_STATE cgen_state;
81 /* Catch address exceptions. */
82 extern SIM_CORE_SIGNAL_FN m32r_core_signal;
83 #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
84 m32r_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
87 /* Default memory size. */
89 #define M32R_DEFAULT_MEM_SIZE 0x2000000 /* 32M */
91 #define M32R_DEFAULT_MEM_SIZE 0x800000 /* 8M */
94 #endif /* SIM_MAIN_H */