From: Mike Frysinger Date: Fri, 22 Jan 2016 02:05:33 +0000 (-0500) Subject: sim: bfin: invert sim_state storage X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85d93de3d8e24b54516ece8ec95ab09e6786e102;p=binutils-gdb.git sim: bfin: invert sim_state storage --- diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index c9b64b11f42..d5c55e07f45 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,10 @@ +2021-05-17 Mike Frysinger + + * interp.c (sim_open): Call sim_state_alloc_extra. + * sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Define. + (struct sim_state): Delete. + (STATE_BOARD_DATA): Define. + 2021-05-16 Mike Frysinger * bfin-sim.c, devices.c, dv-bfin_cec.c, dv-bfin_ctimer.c, diff --git a/sim/bfin/interp.c b/sim/bfin/interp.c index 8e3a1214b78..34357201934 100644 --- a/sim/bfin/interp.c +++ b/sim/bfin/interp.c @@ -717,7 +717,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, { char c; int i; - SIM_DESC sd = sim_state_alloc (kind, callback); + SIM_DESC sd = sim_state_alloc_extra (kind, callback, + sizeof (struct bfin_board_data)); /* The cpu data is kept in a separately allocated chunk of memory. */ if (sim_cpu_alloc_all (sd, 1) != SIM_RC_OK) diff --git a/sim/bfin/sim-main.h b/sim/bfin/sim-main.h index a09ea496189..855a178bc4b 100644 --- a/sim/bfin/sim-main.h +++ b/sim/bfin/sim-main.h @@ -21,6 +21,8 @@ #ifndef _BFIN_MAIN_SIM_H_ #define _BFIN_MAIN_SIM_H_ +#define SIM_HAVE_COMMON_SIM_STATE + #include "sim-basics.h" #include "sim-signal.h" #include "arch.h" @@ -37,14 +39,7 @@ struct _sim_cpu { }; #define BFIN_CPU_STATE ((cpu)->state) -struct sim_state { - sim_cpu *cpu[MAX_NR_PROCESSORS]; - - /* ... simulator specific members ... */ - struct bfin_board_data board; -#define STATE_BOARD_DATA(sd) (&(sd)->board) - sim_state_base base; -}; +#define STATE_BOARD_DATA(sd) ((struct bfin_board_data *) STATE_ARCH_DATA (sd)) #include "sim-config.h" #include "sim-types.h"