/* Main header for the m32r. */
+#ifndef SIM_MAIN_H
+#define SIM_MAIN_H
+
#define USING_SIM_BASE_H /* FIXME: quick hack */
struct _sim_cpu; /* FIXME: should be in sim-basics.h */
typedef struct _sim_cpu SIM_CPU;
-/* sim-basics.h includes config.h but cgen-types.h must be included before
- sim-basics.h and cgen-types.h needs config.h. */
-#include "config.h"
-
-#include "ansidecl.h"
#include "symcat.h"
+#include "sim-basics.h"
#include "cgen-types.h"
+#include "m32r-desc.h"
+#include "m32r-opc.h"
#include "arch.h"
-#include "sim-basics.h"
/* These must be defined before sim-base.h. */
typedef USI sim_cia;
-#define CIA_GET(cpu) CPU_PC_GET (cpu)
-#define CIA_SET(cpu,val) CPU_PC_SET ((cpu), (val))
+#define SIM_ENGINE_HALT_HOOK(sd, cpu, cia) \
+do { \
+ if (cpu) /* null if ctrl-c */ \
+ sim_pc_set ((cpu), (cia)); \
+} while (0)
+#define SIM_ENGINE_RESTART_HOOK(sd, cpu, cia) \
+do { \
+ sim_pc_set ((cpu), (cia)); \
+} while (0)
#include "sim-base.h"
#include "cgen-sim.h"
-#include "cgen-scache.h"
-#include "cgen-cpu.h"
-#include "cgen-trace.h"
-#include "cpu-sim.h"
-#include "cpuall.h"
+#include "m32r-sim.h"
+#include "opcode/cgen.h"
\f
/* The _sim_cpu struct. */
go after here. Oh for a better language. */
#if defined (WANT_CPU_M32RBF)
M32RBF_CPU_DATA cpu_data;
-/* start-sanitize-m32rx */
-#elif defined (WANT_CPU_M32RXF)
+#endif
+#if defined (WANT_CPU_M32RXF)
M32RXF_CPU_DATA cpu_data;
-/* end-sanitize-m32rx */
+#elif defined (WANT_CPU_M32R2F)
+ M32R2F_CPU_DATA cpu_data;
#endif
};
\f
/* The sim_state struct. */
struct sim_state {
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
(TRANSFER), (ERROR))
/* Default memory size. */
+#ifdef M32R_LINUX
+#define M32R_DEFAULT_MEM_SIZE 0x2000000 /* 32M */
+#else
#define M32R_DEFAULT_MEM_SIZE 0x800000 /* 8M */
+#endif
+
+#endif /* SIM_MAIN_H */