aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/sim-main.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-04-15 01:22:34 -0400
committerMike Frysinger <vapier@gentoo.org>2015-04-15 01:25:32 -0400
commitf95f4ed2c4680fea68399691481b277ece11570e (patch)
tree748d1545cd42a16b83339b64bd02327252079e85 /sim/h8300/sim-main.h
parent0ce398f106dac65c3a1d2f7d254213fa652af089 (diff)
downloadfsf-binutils-gdb-f95f4ed2c4680fea68399691481b277ece11570e.zip
fsf-binutils-gdb-f95f4ed2c4680fea68399691481b277ece11570e.tar.gz
fsf-binutils-gdb-f95f4ed2c4680fea68399691481b277ece11570e.tar.bz2
sim: cris/frv/h8300/iq2000/lm32/m32r/sh64: standardize cpu state
This sets up the sim_state structure and the cpu member to match what we do in most other sims, and what the common code suggests. This is a step to unifying on the sim-cpu.o object.
Diffstat (limited to 'sim/h8300/sim-main.h')
-rw-r--r--sim/h8300/sim-main.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h
index 964388a..7126fa3 100644
--- a/sim/h8300/sim-main.h
+++ b/sim/h8300/sim-main.h
@@ -138,7 +138,7 @@ struct _sim_cpu {
/* The sim_state struct. */
struct sim_state {
- struct _sim_cpu *cpu;
+ sim_cpu *cpu[MAX_NR_PROCESSORS];
unsigned int sim_cache_size;
decoded_inst *sim_cache;
unsigned short *cache_idx;
@@ -155,7 +155,11 @@ struct sim_state {
#define CIA_GET(CPU) (cpu_get_pc (CPU))
#define CIA_SET(CPU, VAL) (cpu_set_pc ((CPU), (VAL)))
-#define STATE_CPU(SD, N) ((SD)->cpu) /* Single Processor. */
+#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))