+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
/* The sim_state struct. */
struct sim_state {
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ 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;
+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
/* The sim_state struct. */
struct sim_state {
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ 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;
+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * compile.c: Include sim-options.h.
+ (sim_open): Call sim_cpu_alloc_all instead of sim_cpu_alloc.
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
#include "gdb/sim-h8300.h"
#include "sys/stat.h"
#include "sys/types.h"
+#include "sim-options.h"
#ifndef SIGTRAP
# define SIGTRAP 5
sim_cpu *cpu;
sd = sim_state_alloc (kind, callback);
- sd->cpu = sim_cpu_alloc (sd, 0);
+
+ /* The cpu data is kept in a separately allocated chunk of memory. */
+ if (sim_cpu_alloc_all (sd, 1, /*cgen_cpu_max_extra_bytes ()*/0) != SIM_RC_OK)
+ {
+ free_state (sd);
+ return 0;
+ }
+
cpu = STATE_CPU (sd, 0);
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
sim_state_initialize (sd, 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;
#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))
+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
/* The sim_state struct. */
struct sim_state {
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ 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;
+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
struct sim_state
{
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ 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;
+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
/* The sim_state struct. */
struct sim_state {
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ 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;
+2015-04-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sim-main.h (struct sim_state): Change cpu to an array of pointers.
+ (STATE_CPU): Handle WITH_SMP.
+
2015-04-13 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
/* The sim_state struct. */
struct sim_state {
- sim_cpu *cpu;
-#define STATE_CPU(sd, n) (/*&*/ (sd)->cpu)
+ 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;