aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/Make-common.in1
-rw-r--r--sim/common/sim-base.h14
3 files changed, 15 insertions, 5 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 5c0667b..316771d 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -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.
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index d42fea6..2d1bb8a 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -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 \
diff --git a/sim/common/sim-base.h b/sim/common/sim-base.h
index f7a33cd..0dae541 100644
--- a/sim/common/sim-base.h
+++ b/sim/common/sim-base.h
@@ -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]. */