aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
Diffstat (limited to 'sim')
-rw-r--r--sim/bpf/ChangeLog4
-rw-r--r--sim/bpf/sim-main.h9
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/cgen-defs.h2
-rw-r--r--sim/common/sim-base.h10
-rw-r--r--sim/cris/ChangeLog4
-rw-r--r--sim/cris/sim-main.h10
-rw-r--r--sim/frv/ChangeLog4
-rw-r--r--sim/frv/sim-main.h10
-rw-r--r--sim/iq2000/ChangeLog4
-rw-r--r--sim/iq2000/sim-main.h10
-rw-r--r--sim/lm32/ChangeLog4
-rw-r--r--sim/lm32/sim-main.h11
-rw-r--r--sim/m32r/ChangeLog4
-rw-r--r--sim/m32r/sim-main.h10
-rw-r--r--sim/or1k/ChangeLog5
-rw-r--r--sim/or1k/sim-main.h14
17 files changed, 49 insertions, 74 deletions
diff --git a/sim/bpf/ChangeLog b/sim/bpf/ChangeLog
index 69156e6..f5f5716 100644
--- a/sim/bpf/ChangeLog
+++ b/sim/bpf/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* bpf-helpers.c, bpf.c, sim-if.c, traps.c: Include defs.h.
diff --git a/sim/bpf/sim-main.h b/sim/bpf/sim-main.h
index 84943d1..571c14c 100644
--- a/sim/bpf/sim-main.h
+++ b/sim/bpf/sim-main.h
@@ -39,13 +39,4 @@ struct _sim_cpu
#endif
};
-
-
-struct sim_state
-{
- sim_cpu *cpu[MAX_NR_PROCESSORS];
- CGEN_STATE cgen_state;
- sim_state_base base;
-};
-
#endif /* ! SIM_MAIN_H */
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index f3fcaee..3a6c31a 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,13 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
+ * cgen-defs.h (STATE_RUN_FAST_P): Call STATE_CGEN_STATE.
+ * sim-base.h [CGEN_ARCH]: Include cgen-sim.h and define
+ SIM_HAVE_COMMON_SIM_STATE.
+ (struct sim_state): Add cgen_state.
+ (STATE_CGEN_STATE): Define.
+
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
* sim-base.h (struct sim_state): Update comment.
(struct sim_state): Define.
(STATE_ARCH_DATA): Likewise.
diff --git a/sim/common/cgen-defs.h b/sim/common/cgen-defs.h
index 0d598ce..dab2f9f 100644
--- a/sim/common/cgen-defs.h
+++ b/sim/common/cgen-defs.h
@@ -146,7 +146,7 @@ typedef enum {
typedef struct cgen_state {
/* Non-zero if no tracing or profiling is selected. */
int run_fast_p;
-#define STATE_RUN_FAST_P(sd) ((sd) -> cgen_state.run_fast_p)
+#define STATE_RUN_FAST_P(sd) (STATE_CGEN_STATE (sd).run_fast_p)
} CGEN_STATE;
/* Various utilities. */
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index f38e841..e552d94 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -88,6 +88,10 @@ typedef struct _sim_cpu sim_cpu;
#include "sim-cpu.h"
#include "sim-assert.h"
+#ifdef CGEN_ARCH
+# include "cgen-sim.h"
+# define SIM_HAVE_COMMON_SIM_STATE
+#endif
/* We require all sims to dynamically allocate cpus. See comment up top about
struct sim_state. */
@@ -232,6 +236,12 @@ struct sim_state {
target should define a struct and use it here. */
void *arch_data;
#define STATE_ARCH_DATA(sd) ((sd)->arch_data)
+
+#ifdef CGEN_ARCH
+ /* Various cgen runtime state. */
+ CGEN_STATE cgen_state;
+#endif
+#define STATE_CGEN_STATE(sd) ((sd)->cgen_state)
};
#endif
diff --git a/sim/cris/ChangeLog b/sim/cris/ChangeLog
index 80b0d7c..06ca4e4 100644
--- a/sim/cris/ChangeLog
+++ b/sim/cris/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* cris-tmpl.c, crisv10f.c, crisv32f.c, dv-cris.c, dv-cris_900000xx.c,
diff --git a/sim/cris/sim-main.h b/sim/cris/sim-main.h
index 3bd8612..be75e22 100644
--- a/sim/cris/sim-main.h
+++ b/sim/cris/sim-main.h
@@ -205,16 +205,6 @@ struct _sim_cpu {
#endif
};
-/* The sim_state struct. */
-
-struct sim_state {
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- CGEN_STATE cgen_state;
-
- sim_state_base base;
-};
-
/* Misc. */
/* Catch address exceptions. */
diff --git a/sim/frv/ChangeLog b/sim/frv/ChangeLog
index e9e9463..d94526a 100644
--- a/sim/frv/ChangeLog
+++ b/sim/frv/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* cache.c, frv.c, interrupts.c, memory.c, options.c, pipeline.c,
diff --git a/sim/frv/sim-main.h b/sim/frv/sim-main.h
index 1515c32..e2b09a3 100644
--- a/sim/frv/sim-main.h
+++ b/sim/frv/sim-main.h
@@ -104,16 +104,6 @@ struct _sim_cpu {
#endif /* defined (WANT_CPU_FRVBF) */
};
-/* The sim_state struct. */
-
-struct sim_state {
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- CGEN_STATE cgen_state;
-
- sim_state_base base;
-};
-
/* Misc. */
/* Catch address exceptions. */
diff --git a/sim/iq2000/ChangeLog b/sim/iq2000/ChangeLog
index b21e075..d5805ed 100644
--- a/sim/iq2000/ChangeLog
+++ b/sim/iq2000/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* iq2000.c, sim-if.c: Include defs.h.
diff --git a/sim/iq2000/sim-main.h b/sim/iq2000/sim-main.h
index d0ae1cf..3615a71 100644
--- a/sim/iq2000/sim-main.h
+++ b/sim/iq2000/sim-main.h
@@ -43,16 +43,6 @@ struct _sim_cpu {
#endif
};
-/* The sim_state struct. */
-
-struct sim_state {
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- CGEN_STATE cgen_state;
-
- sim_state_base base;
-};
-
/* Misc. */
/* Catch address exceptions. */
diff --git a/sim/lm32/ChangeLog b/sim/lm32/ChangeLog
index db0e8f0..c014a6d 100644
--- a/sim/lm32/ChangeLog
+++ b/sim/lm32/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* dv-lm32cpu.c, dv-lm32timer.c, dv-lm32uart.c, lm32.c, sim-if.c,
diff --git a/sim/lm32/sim-main.h b/sim/lm32/sim-main.h
index d00412f..c53557a 100644
--- a/sim/lm32/sim-main.h
+++ b/sim/lm32/sim-main.h
@@ -59,17 +59,6 @@ struct _sim_cpu
};
-/* The sim_state struct. */
-
-struct sim_state
-{
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- CGEN_STATE cgen_state;
-
- sim_state_base base;
-};
-
/* Misc. */
/* Catch address exceptions. */
diff --git a/sim/m32r/ChangeLog b/sim/m32r/ChangeLog
index 2e099a0..04d342d 100644
--- a/sim/m32r/ChangeLog
+++ b/sim/m32r/ChangeLog
@@ -1,3 +1,7 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* dv-m32r_cache.c, dv-m32r_uart.c: Replace config.h include with
diff --git a/sim/m32r/sim-main.h b/sim/m32r/sim-main.h
index 5b24ce8..f89db48 100644
--- a/sim/m32r/sim-main.h
+++ b/sim/m32r/sim-main.h
@@ -48,16 +48,6 @@ struct _sim_cpu {
#endif
};
-/* The sim_state struct. */
-
-struct sim_state {
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- CGEN_STATE cgen_state;
-
- sim_state_base base;
-};
-
/* Misc. */
/* Catch address exceptions. */
diff --git a/sim/or1k/ChangeLog b/sim/or1k/ChangeLog
index af6afc4..3484c07 100644
--- a/sim/or1k/ChangeLog
+++ b/sim/or1k/ChangeLog
@@ -1,3 +1,8 @@
+2021-05-17 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h: Move or1k-opc.h include.
+ (struct sim_state): Delete.
+
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* sim-main.h: Delete config.h include.
diff --git a/sim/or1k/sim-main.h b/sim/or1k/sim-main.h
index f91a351..1727fe8 100644
--- a/sim/or1k/sim-main.h
+++ b/sim/or1k/sim-main.h
@@ -23,13 +23,13 @@
#include "ansidecl.h"
#include "or1k-desc.h"
+#include "or1k-opc.h"
#include "sim-basics.h"
#include "cgen-types.h"
#include "arch.h"
#include "sim-base.h"
#include "sim-fpu.h"
-#include "or1k-opc.h"
#include "cgen-sim.h"
#include "or1k-sim.h"
@@ -66,16 +66,4 @@ struct _sim_cpu
#endif
};
-
-
-/* The sim_state struct. */
-struct sim_state
-{
- sim_cpu *cpu[MAX_NR_PROCESSORS];
-
- CGEN_STATE cgen_state;
-
- sim_state_base base;
-};
-
#endif /* SIM_MAIN_H */