sim: cgen: invert sim_state storage for cgen ports

This commit is contained in:
Mike Frysinger 2016-01-21 21:13:06 -05:00
parent 85d93de3d8
commit e106fc358c
17 changed files with 49 additions and 74 deletions

View File

@ -1,3 +1,7 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* bpf-helpers.c, bpf.c, sim-if.c, traps.c: Include defs.h.

View File

@ -39,13 +39,4 @@ struct _sim_cpu
#endif
};
struct sim_state
{
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
#endif /* ! SIM_MAIN_H */

View File

@ -1,3 +1,11 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* cgen-defs.h (STATE_RUN_FAST_P): Call STATE_CGEN_STATE.
* sim-base.h [CGEN_ARCH]: Include cgen-sim.h and define
SIM_HAVE_COMMON_SIM_STATE.
(struct sim_state): Add cgen_state.
(STATE_CGEN_STATE): Define.
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-base.h (struct sim_state): Update comment.

View File

@ -146,7 +146,7 @@ typedef enum {
typedef struct cgen_state {
/* Non-zero if no tracing or profiling is selected. */
int run_fast_p;
#define STATE_RUN_FAST_P(sd) ((sd) -> cgen_state.run_fast_p)
#define STATE_RUN_FAST_P(sd) (STATE_CGEN_STATE (sd).run_fast_p)
} CGEN_STATE;
/* Various utilities. */

View File

@ -88,6 +88,10 @@ typedef struct _sim_cpu sim_cpu;
#include "sim-cpu.h"
#include "sim-assert.h"
#ifdef CGEN_ARCH
# include "cgen-sim.h"
# define SIM_HAVE_COMMON_SIM_STATE
#endif
/* We require all sims to dynamically allocate cpus. See comment up top about
struct sim_state. */
@ -232,6 +236,12 @@ struct sim_state {
target should define a struct and use it here. */
void *arch_data;
#define STATE_ARCH_DATA(sd) ((sd)->arch_data)
#ifdef CGEN_ARCH
/* Various cgen runtime state. */
CGEN_STATE cgen_state;
#endif
#define STATE_CGEN_STATE(sd) ((sd)->cgen_state)
};
#endif

View File

@ -1,3 +1,7 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* cris-tmpl.c, crisv10f.c, crisv32f.c, dv-cris.c, dv-cris_900000xx.c,

View File

@ -205,16 +205,6 @@ struct _sim_cpu {
#endif
};
/* The sim_state struct. */
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
/* Misc. */
/* Catch address exceptions. */

View File

@ -1,3 +1,7 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* cache.c, frv.c, interrupts.c, memory.c, options.c, pipeline.c,

View File

@ -104,16 +104,6 @@ struct _sim_cpu {
#endif /* defined (WANT_CPU_FRVBF) */
};
/* The sim_state struct. */
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
/* Misc. */
/* Catch address exceptions. */

View File

@ -1,3 +1,7 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* iq2000.c, sim-if.c: Include defs.h.

View File

@ -43,16 +43,6 @@ struct _sim_cpu {
#endif
};
/* The sim_state struct. */
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
/* Misc. */
/* Catch address exceptions. */

View File

@ -1,3 +1,7 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* dv-lm32cpu.c, dv-lm32timer.c, dv-lm32uart.c, lm32.c, sim-if.c,

View File

@ -57,17 +57,6 @@ struct _sim_cpu
LM32BF_CPU_DATA cpu_data;
#endif
};
/* The sim_state struct. */
struct sim_state
{
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
/* Misc. */

View File

@ -1,3 +1,7 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h (struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* dv-m32r_cache.c, dv-m32r_uart.c: Replace config.h include with

View File

@ -48,16 +48,6 @@ struct _sim_cpu {
#endif
};
/* The sim_state struct. */
struct sim_state {
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
/* Misc. */
/* Catch address exceptions. */

View File

@ -1,3 +1,8 @@
2021-05-17 Mike Frysinger <vapier@gentoo.org>
* sim-main.h: Move or1k-opc.h include.
(struct sim_state): Delete.
2021-05-16 Mike Frysinger <vapier@gentoo.org>
* sim-main.h: Delete config.h include.

View File

@ -23,13 +23,13 @@
#include "ansidecl.h"
#include "or1k-desc.h"
#include "or1k-opc.h"
#include "sim-basics.h"
#include "cgen-types.h"
#include "arch.h"
#include "sim-base.h"
#include "sim-fpu.h"
#include "or1k-opc.h"
#include "cgen-sim.h"
#include "or1k-sim.h"
@ -66,16 +66,4 @@ struct _sim_cpu
#endif
};
/* The sim_state struct. */
struct sim_state
{
sim_cpu *cpu[MAX_NR_PROCESSORS];
CGEN_STATE cgen_state;
sim_state_base base;
};
#endif /* SIM_MAIN_H */