aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-01-21 21:13:06 -0500
committerMike Frysinger <vapier@gentoo.org>2021-05-17 00:46:32 -0400
commite106fc358c217f8f1e09cfdd383f564178c8f5eb (patch)
tree58cfffc4d30435963e4d9ce7ce7c7ca77635ae63 /sim/common
parent85d93de3d8e24b54516ece8ec95ab09e6786e102 (diff)
downloadgdb-e106fc358c217f8f1e09cfdd383f564178c8f5eb.zip
gdb-e106fc358c217f8f1e09cfdd383f564178c8f5eb.tar.gz
gdb-e106fc358c217f8f1e09cfdd383f564178c8f5eb.tar.bz2
sim: cgen: invert sim_state storage for cgen ports
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog8
-rw-r--r--sim/common/cgen-defs.h2
-rw-r--r--sim/common/sim-base.h10
3 files changed, 19 insertions, 1 deletions
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