aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-11-01 18:49:48 +0545
committerMike Frysinger <vapier@gentoo.org>2022-12-21 00:00:01 -0500
commit53891d9a7ccc2a94f45711dbbb8c3519eb7bcee1 (patch)
tree03c3483dee93e83448b82b8d84c067782f57a7ff /sim/common
parent5409cab77ed607c4bb87160cf98861fad1e97381 (diff)
downloadbinutils-53891d9a7ccc2a94f45711dbbb8c3519eb7bcee1.zip
binutils-53891d9a7ccc2a94f45711dbbb8c3519eb7bcee1.tar.gz
binutils-53891d9a7ccc2a94f45711dbbb8c3519eb7bcee1.tar.bz2
sim: cgen: prep for inverting sim_cpu storage
Some common cgen code changes to allow cgen ports to invert their sim_cpu storage one-by-one.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/cgen-cpu.h5
-rw-r--r--sim/common/sim-cpu.h10
2 files changed, 15 insertions, 0 deletions
diff --git a/sim/common/cgen-cpu.h b/sim/common/cgen-cpu.h
index 92161a8..d65e0db 100644
--- a/sim/common/cgen-cpu.h
+++ b/sim/common/cgen-cpu.h
@@ -20,6 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef CGEN_CPU_H
#define CGEN_CPU_H
+#include "cgen-defs.h"
+#include "cgen-fpu.h"
+#include "cgen-par.h"
+#include "cgen-scache.h"
+
/* Type of function that is ultimately called by sim_resume. */
typedef void (ENGINE_FN) (SIM_CPU *);
diff --git a/sim/common/sim-cpu.h b/sim/common/sim-cpu.h
index ab41508..e895664 100644
--- a/sim/common/sim-cpu.h
+++ b/sim/common/sim-cpu.h
@@ -28,6 +28,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Type of function to return an insn name. */
typedef const char * (CPU_INSN_NAME_FN) (sim_cpu *, int);
+#ifdef CGEN_ARCH
+# include "cgen-cpu.h"
+#endif
+
/* Types for register access functions.
These routines implement the sim_{fetch,store}_register interface. */
typedef int (CPUREG_FETCH_FN) (sim_cpu *, int, void *, int);
@@ -127,6 +131,12 @@ struct _sim_cpu {
/* All the common state. */
sim_cpu_base base;
+#ifdef CGEN_ARCH
+ /* Static parts of cgen. */
+ CGEN_CPU cgen_cpu;
+#define CPU_CGEN_CPU(cpu) ((cpu)->cgen_cpu)
+#endif
+
/* Pointer for sim target to store arbitrary cpu data. Normally the
target should define a struct and use it here. */
void *arch_data;