sim: replace CIA_{GET,SET} with CPU_PC_{GET,SET}
[deliverable/binutils-gdb.git] / sim / m32r / sim-main.h
index 923465fde21c536ace8e4b884427121202311f93..661d9cf9e3abf112b962e1199b1427da98ed340d 100644 (file)
@@ -1,33 +1,37 @@
 /* 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.  */
 
@@ -50,18 +54,18 @@ struct _sim_cpu {
      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;
 
@@ -77,4 +81,10 @@ m32r_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
                  (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 */
This page took 0.02349 seconds and 4 git commands to generate.