sim: unify sim-cpu usage

Now that all the targets are utilizing CPU_PC_{FETCH,STORE}, and the
cpu state is multicore, and the STATE_CPU defines match, we can move
it all to the common code.
This commit is contained in:
Mike Frysinger 2015-04-15 02:13:23 -04:00
parent f95f4ed2c4
commit 78e9aa70fe
69 changed files with 126 additions and 139 deletions

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -22,7 +22,6 @@ SIM_EXTRA_CFLAGS = -DMODET
SIM_OBJS = \
wrapper.o \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
armemu26.o armemu32.o arminit.o armos.o armsupp.o \
armvirt.o bag.o thumbemu.o \

View File

@ -44,11 +44,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -19,7 +19,6 @@
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
interp.o \
sim-cpu.o \
sim-hload.o \
sim-reason.o \
sim-resume.o \

View File

@ -39,11 +39,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -27,7 +27,6 @@ SIM_OBJS = \
gui.o \
interp.o \
machs.o \
sim-cpu.o \
sim-hload.o \
sim-model.o \
sim-reason.o \

View File

@ -46,11 +46,7 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
/* ... simulator specific members ... */
struct bfin_board_data board;
#define STATE_BOARD_DATA(sd) (&(sd)->board)

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_NEW_COMMON_OBJS): Add sim-cpu.o.
* sim-main.h (STATE_CPU): Remove from comment and define.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* acinclude.m4 (ACX_PKGVERSION): Change GDB to SIM.

View File

@ -176,6 +176,7 @@ SIM_NEW_COMMON_OBJS = \
sim-command.o \
sim-config.o \
sim-core.o \
sim-cpu.o \
sim-endian.o \
sim-engine.o \
sim-events.o \

View File

@ -44,11 +44,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
... simulator specific members ...
sim_state_base base;
};
@ -116,6 +111,15 @@ extern struct sim_state *current_state;
#endif
/* We require all sims to dynamically allocate cpus. See comment up top about
struct sim_state. */
#if (WITH_SMP)
# define STATE_CPU(sd, n) ((sd)->cpu[n])
#else
# define STATE_CPU(sd, n) ((sd)->cpu[0])
#endif
typedef struct {
/* Simulator's argv[0]. */

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -19,7 +19,6 @@
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
interp.o \
table.o \

View File

@ -43,11 +43,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Change cpu to an array of pointers.

View File

@ -24,7 +24,6 @@ CRISV32F_OBJS = crisv32f.o cpuv32.o decodev32.o modelv32.o mloopv32f.o
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-model.o \
sim-reg.o \
cgen-utils.o cgen-trace.o cgen-scache.o \

View File

@ -226,11 +226,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
CGEN_STATE cgen_state;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -20,7 +20,6 @@
SIM_OBJS = \
interp.o \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
table.o \
simops.o \

View File

@ -43,11 +43,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Change cpu to an array of pointers.

View File

@ -21,7 +21,6 @@ FRV_OBJS = frv.o cpu.o decode.o sem.o model.o mloop.o cgen-par.o
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-model.o \
sim-reg.o \

View File

@ -119,11 +119,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
CGEN_STATE cgen_state;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -24,7 +24,6 @@ SIM_OBJS = \
sim-bits.o \
sim-config.o \
sim-core.o \
sim-cpu.o \
sim-endian.o \
sim-events.o \
sim-fpu.o \

View File

@ -46,11 +46,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* compile.c: Include sim-options.h.

View File

@ -19,7 +19,6 @@
SIM_OBJS = compile.o \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-load.o
## COMMON_POST_CONFIG_FRAG

View File

@ -155,11 +155,6 @@ struct sim_state {
#define CIA_GET(CPU) (cpu_get_pc (CPU))
#define CIA_SET(CPU, VAL) (cpu_set_pc ((CPU), (VAL)))
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
#define cpu_set_pc(CPU, VAL) (((CPU)->pc) = (VAL))
#define cpu_get_pc(CPU) (((CPU)->pc))

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Change cpu to an array of pointers.

View File

@ -21,7 +21,6 @@ IQ2000_OBJS = iq2000.o cpu.o decode.o sem.o model.o mloop.o
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-model.o \
sim-reg.o \

View File

@ -58,11 +58,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
CGEN_STATE cgen_state;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Change cpu to an array of pointers.

View File

@ -6,7 +6,6 @@
# List of object files, less common parts.
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-model.o \
sim-reg.o \

View File

@ -84,11 +84,6 @@ struct _sim_cpu
struct sim_state
{
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
CGEN_STATE cgen_state;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Change cpu to an array of pointers.

View File

@ -26,7 +26,6 @@ TRAPS_OBJ = @traps_obj@
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-model.o \
sim-reg.o \

View File

@ -69,11 +69,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
CGEN_STATE cgen_state;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -22,7 +22,6 @@ M68HC11_OBJS = interp.o m68hc11int.o m68hc12int.o \
SIM_OBJS = $(M68HC11_OBJS) \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-load.o \
sim-hload.o \
sim-stop.o \

View File

@ -577,12 +577,6 @@ extern void m68hc11cpu_set_port (struct hw *me, sim_cpu *cpu,
#define CIA_GET(CPU) (cpu_get_pc (CPU))
#define CIA_SET(CPU,VAL) (cpu_set_pc ((CPU), (VAL)))
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
device *devices;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -20,7 +20,6 @@
SIM_OBJS = \
interp.o \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-stop.o

View File

@ -43,11 +43,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -20,7 +20,6 @@
SIM_OBJS = \
interp.o \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-reason.o \
sim-stop.o

View File

@ -62,11 +62,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -46,7 +46,6 @@ SIM_OBJS = \
cp1.o \
mdmx.o \
dsp.o \
sim-cpu.o \
sim-main.o \
sim-hload.o \
sim-stop.o \

View File

@ -489,11 +489,6 @@ struct sim_state {
struct swatch watch;
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (MN10300_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -21,7 +21,6 @@ MN10300_OBJS = \
itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
$(SIM_NEW_COMMON_OBJS) \
op_utils.o \
sim-cpu.o \
sim-hload.o \
sim-resume.o \
sim-reason.o \

View File

@ -86,11 +86,6 @@ struct sim_state {
/* the processors proper */
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
/* The base class. */
sim_state_base base;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -22,7 +22,6 @@ dtbdir = @datadir@/gdb/dtb
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
interp.o \
sim-cpu.o \
sim-hload.o \
sim-reason.o \
sim-resume.o \

View File

@ -47,11 +47,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -28,7 +28,6 @@ SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
msp430-sim.o \
trace.o \
sim-cpu.o \
sim-hload.o \
sim-reason.o \
sim-reg.o \

View File

@ -42,12 +42,6 @@ struct sim_state
{
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#error WITH_SMP not supported by MSP430 sim
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
asymbol **symbol_table;
long number_of_symbols;
#define STATE_SYMBOL_TABLE(sd) ((sd)->symbol_table)

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -20,7 +20,6 @@
SIM_OBJS = \
interp.o \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-stop.o \
table.o

View File

@ -142,11 +142,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
sim_state_base base;
};

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Change cpu to an array of pointers.

View File

@ -23,7 +23,6 @@ SH64_OBJS = sh64.o cpu.o sh-desc.o \
SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
sim-cpu.o \
sim-hload.o \
sim-model.o \
sim-reg.o \

View File

@ -54,11 +54,6 @@ struct _sim_cpu {
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
CGEN_STATE cgen_state;

View File

@ -1,3 +1,8 @@
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
* sim-main.h (STATE_CPU): Delete.
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.

View File

@ -23,7 +23,6 @@ SIM_OBJS = \
$(SIM_NEW_COMMON_OBJS) \
simops.o interp.o \
itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
sim-cpu.o \
sim-hload.o \
sim-resume.o \
sim-reason.o \

View File

@ -66,11 +66,6 @@ struct _sim_cpu
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
#if (WITH_SMP)
#define STATE_CPU(sd,n) ((sd)->cpu[n])
#else
#define STATE_CPU(sd,n) ((sd)->cpu[0])
#endif
#if 0
SIM_ADDR rom_size;
SIM_ADDR low_end;