@@ -14,8 +14,6 @@
#include <stdlib.h>
#include <string.h>
-#include "bfd.h"
-
struct _state State;
similarity index 94%
rename from sim/mn10300/mn10300_sim.h
rename to sim/mn10300/mn10300-sim.h
@@ -1,14 +1,8 @@
-#include <stdio.h>
-#include <ctype.h>
-#include "ansidecl.h"
-#include "sim/callback.h"
-#include "opcode/mn10300.h"
-#include <limits.h>
-#include "sim/sim.h"
-#include "bfd.h"
-#include "sim-fpu.h"
-#include "sim-signal.h"
+#ifndef MN10300_SIM_H
+#define MN10300_SIM_H
+/* For compatibility, until all functions converted to passing
+ SIM_DESC as an argument */
extern SIM_DESC simulator;
typedef struct
@@ -185,6 +179,14 @@ dw2u64 (dword data)
return data.low | (((uint64_t)data.high) << 32);
}
+/* Bring data in from the cold */
+
+#define IMEM8(EA) \
+(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA)))
+
+#define IMEM8_IMMED(EA, N) \
+(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA) + (N)))
+
/* Function declarations. */
INLINE_SIM_MAIN (void) genericAdd (uint32_t source, uint32_t destReg);
@@ -225,3 +227,5 @@ void fpu_fmadd (SIM_DESC, sim_cpu *, address_word, const void *, const void *,
void fpu_fmsub (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
void fpu_fnmadd (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
void fpu_fnmsub (SIM_DESC, sim_cpu *, address_word, const void *, const void *, const void *, void *, const struct fp_prec_t *);
+
+#endif
@@ -1,10 +1,7 @@
/* This must come before any other includes. */
#include "defs.h"
-#include "sim-main.h"
-#include "sim-signal.h"
-#include "sim-syscall.h"
-
+#include <errno.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@@ -13,6 +10,11 @@
#include <sys/stat.h>
#include <sys/time.h>
+#include "sim/callback.h"
+
+#include "sim-main.h"
+#include "sim-signal.h"
+#include "sim-syscall.h"
#define REG0(X) ((X) & 0x3)
@@ -26,40 +26,20 @@
#include "sim-basics.h"
-#include <signal.h> /* For kill() in insns:do_trap */
-
-#include <errno.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-/* These are generated files. */
-#include "itable.h"
-#include "idecode.h"
-
#define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
mn10300_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), (TRANSFER), (ERROR))
-
#include "sim-base.h"
-#include "mn10300_sim.h"
-
-/* Bring data in from the cold */
-
-#define IMEM8(EA) \
-(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA)))
-
-#define IMEM8_IMMED(EA, N) \
-(sim_core_read_aligned_1(STATE_CPU(sd, 0), EA, exec_map, (EA) + (N)))
-
-/* For compatibility, until all functions converted to passing
- SIM_DESC as an argument */
-extern SIM_DESC simulator;
+/**
+ * TODO: Move these includes to the igen files that need them.
+ * This requires extending the igen syntax to support header includes.
+ */
+#include "sim-fpu.h"
+#include "sim-signal.h"
-/* (re) initialize the simulator */
+#include "mn10300-sim.h"
-extern void engine_init(SIM_DESC sd);
extern SIM_CORE_SIGNAL_FN mn10300_core_signal;
#endif