sim: cgen: prep for inverting sim_cpu storage
authorMike Frysinger <vapier@gentoo.org>
Tue, 1 Nov 2022 13:04:48 +0000 (18:49 +0545)
committerMike Frysinger <vapier@gentoo.org>
Wed, 21 Dec 2022 05:00:01 +0000 (00:00 -0500)
Some common cgen code changes to allow cgen ports to invert their
sim_cpu storage one-by-one.

sim/common/cgen-cpu.h
sim/common/sim-cpu.h

index 92161a84b8756be80ca3c2008452cc3fc3a89227..d65e0dba0b2002c50086668bc18184d821ba709b 100644 (file)
@@ -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 *);
 
index ab41508acb65f060c8925c91ee0379d39c3d73d3..e895664c2efb7d35bc0776e1d5e0d26a88713164 100644 (file)
@@ -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;