]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: m32r: invert 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)
The cpu*.h changes are in generated cgen code, but that has been sent
upstream too, so the next regen should include it automatically.

sim/m32r/cpu.h
sim/m32r/cpu2.h
sim/m32r/cpux.h
sim/m32r/sim-if.c
sim/m32r/sim-main.h

index 71a375f695ce7f598fc50ac2ce32a60d4f13b807..9079b74bb7d903682f0d1e8754f7841f0c55691a 100644 (file)
@@ -87,7 +87,7 @@ m32rbf_h_psw_set_handler (current_cpu, (x));\
 #define GET_H_LOCK() CPU (h_lock)
 #define SET_H_LOCK(x) (CPU (h_lock) = (x))
   } hardware;
-#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
+#define CPU_CGEN_HW(cpu) (& M32R_SIM_CPU (cpu)->cpu_data.hardware)
 } M32RBF_CPU_DATA;
 
 /* Cover fns for register access.  */
index bd98a98a0c8da25ea59952409b86d6b178b784ed..5dc4d64db0cda9a08817dc8c50683d1909d01a5d 100644 (file)
@@ -94,7 +94,7 @@ m32r2f_h_psw_set_handler (current_cpu, (x));\
 #define GET_H_LOCK() CPU (h_lock)
 #define SET_H_LOCK(x) (CPU (h_lock) = (x))
   } hardware;
-#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
+#define CPU_CGEN_HW(cpu) (& M32R_SIM_CPU (cpu)->cpu_data.hardware)
 } M32R2F_CPU_DATA;
 
 /* Cover fns for register access.  */
index 1e6d84fc4685306362f8bc388e65064b44e77abd..f2496b0754331314a5e9a36bb70f17aaa89e9af9 100644 (file)
@@ -94,7 +94,7 @@ m32rxf_h_psw_set_handler (current_cpu, (x));\
 #define GET_H_LOCK() CPU (h_lock)
 #define SET_H_LOCK(x) (CPU (h_lock) = (x))
   } hardware;
-#define CPU_CGEN_HW(cpu) (& (cpu)->cpu_data.hardware)
+#define CPU_CGEN_HW(cpu) (& M32R_SIM_CPU (cpu)->cpu_data.hardware)
 } M32RXF_CPU_DATA;
 
 /* Cover fns for register access.  */
index 878a0d5f576412578c6feabf83601f50b3579d9b..401d1020d7049be412c6e23cce174a8292029c83 100644 (file)
@@ -66,7 +66,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
   current_target_byte_order = BFD_ENDIAN_BIG;
 
   /* The cpu data is kept in a separately allocated chunk of memory.  */
-  if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK)
+  if (sim_cpu_alloc_all_extra (sd, 1, sizeof (struct m32r_sim_cpu))
+      != SIM_RC_OK)
     {
       free_state (sd);
       return 0;
index 2ce989a897a1a8fd339cae5040279e3841cc0b77..fcde7feb61ccdf2cb174b742ca70939153b79bb4 100644 (file)
@@ -3,6 +3,8 @@
 #ifndef SIM_MAIN_H
 #define SIM_MAIN_H
 
+#define SIM_HAVE_COMMON_SIM_CPU
+
 /* This is a global setting.  Different cpu families can't mix-n-match -scache
    and -pbb.  However some cpu families may use -simple while others use
    one of -scache/-pbb.  */
 #include "m32r-sim.h"
 #include "opcode/cgen.h"
 \f
-/* The _sim_cpu struct.  */
-
-struct _sim_cpu {
-  /* sim/common cpu base.  */
-  sim_cpu_base base;
-
-  /* Static parts of cgen.  */
-  CGEN_CPU cgen_cpu;
-
+struct m32r_sim_cpu {
   M32R_MISC_PROFILE m32r_misc_profile;
-#define CPU_M32R_MISC_PROFILE(cpu) (& (cpu)->m32r_misc_profile)
+#define CPU_M32R_MISC_PROFILE(cpu) (& M32R_SIM_CPU (cpu)->m32r_misc_profile)
 
   /* CPU specific parts go here.
      Note that in files that don't need to access these pieces WANT_CPU_FOO
@@ -47,6 +41,7 @@ struct _sim_cpu {
   M32R2F_CPU_DATA cpu_data;
 #endif
 };
+#define M32R_SIM_CPU(cpu) ((struct m32r_sim_cpu *) CPU_ARCH_DATA (cpu))
 \f
 /* Misc.  */