public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim: cgen: prep for inverting sim_cpu storage
@ 2022-12-21  5:08 Michael Frysinger
  0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2022-12-21  5:08 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=53891d9a7ccc2a94f45711dbbb8c3519eb7bcee1

commit 53891d9a7ccc2a94f45711dbbb8c3519eb7bcee1
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Nov 1 18:49:48 2022 +0545

    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.

Diff:
---
 sim/common/cgen-cpu.h |  5 +++++
 sim/common/sim-cpu.h  | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/sim/common/cgen-cpu.h b/sim/common/cgen-cpu.h
index 92161a84b87..d65e0dba0b2 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 ab41508acb6..e895664c2ef 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-21  5:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21  5:08 [binutils-gdb] sim: cgen: prep for inverting sim_cpu storage Michael Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).