This makes the common sim-cpu logic work.
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * wrapper.c (arm_pc_get, arm_pc_set): New functions.
+ (sim_open): Declare new local var i. Call CPU_PC_FETCH &
+ CPU_PC_STORE for all cpus.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
sim_target_parse_command_line (i, argv);
}
+static sim_cia
+arm_pc_get (sim_cpu *cpu)
+{
+ return PC;
+}
+
+static void
+arm_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ ARMul_SetPC (state, pc);
+}
+
static void
free_state (SIM_DESC sd)
{
struct bfd *abfd,
char **argv)
{
+ int i;
SIM_DESC sd = sim_state_alloc (kind, cb);
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = arm_pc_get;
+ CPU_PC_STORE (cpu) = arm_pc_set;
+ }
+
sim_callback = cb;
sim_target_parse_arg_array (argv);
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (cr16_pc_get, cr16_pc_set): New functions.
+ (sim_open): Call CPU_PC_FETCH & CPU_PC_STORE for all cpus.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
return xfer_mem (sd, addr, buffer, size, 0);
}
+static sim_cia
+cr16_pc_get (sim_cpu *cpu)
+{
+ return PC;
+}
+
+static void
+cr16_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ SET_PC (pc);
+}
+
static void
free_state (SIM_DESC sd)
{
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = cr16_pc_get;
+ CPU_PC_STORE (cpu) = cr16_pc_set;
+ }
+
trace_sd = sd;
cr16_callback = cb;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (d10v_pc_get, d10v_pc_set): New functions.
+ (sim_open): Declare new local var i. Call CPU_PC_FETCH &
+ CPU_PC_STORE for all cpus.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
return xfer_mem( addr, buffer, size, 0);
}
+static sim_cia
+d10v_pc_get (sim_cpu *cpu)
+{
+ return PC;
+}
+
+static void
+d10v_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ SET_PC (pc);
+}
+
static void
free_state (SIM_DESC sd)
{
struct hash_entry *h;
static int init_p = 0;
char **p;
+ int i;
SIM_DESC sd = sim_state_alloc (kind, cb);
SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = d10v_pc_get;
+ CPU_PC_STORE (cpu) = d10v_pc_set;
+ }
+
trace_sd = sd;
d10v_callback = cb;
old_segment_mapping = 0;
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * compile.c (h8300_pc_get, h8300_pc_set): New functions.
+ (sim_open): Declare new local var i. Call CPU_PC_FETCH &
+ CPU_PC_STORE for all cpus.
+ * sim-main.h (SIM_CPU): Define.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
h8300_normal_mode = 1;
}
+static sim_cia
+h8300_pc_get (sim_cpu *cpu)
+{
+ return cpu->pc;
+}
+
+static void
+h8300_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ cpu->pc = pc;
+}
+
/* Cover function of sim_state_free to free the cpu buffers as well. */
static void
struct bfd *abfd,
char **argv)
{
+ int i;
SIM_DESC sd;
sim_cpu *cpu;
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = h8300_pc_get;
+ CPU_PC_STORE (cpu) = h8300_pc_set;
+ }
+
/* sim_hw_configure (sd); */
/* FIXME: Much of the code in sim_load can be moved here. */
/* Define sim_cia. */
typedef unsigned32 sim_cia;
+typedef struct _sim_cpu SIM_CPU;
+
#include "sim-base.h"
/* Structure used to describe addressing */
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (microblaze_pc_get, microblaze_pc_set): New functions.
+ (sim_open): Call CPU_PC_FETCH & CPU_PC_STORE for all cpus.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
(CPU.cycles) ? CPU.cycles+2 : 0);
}
+static sim_cia
+microblaze_pc_get (sim_cpu *cpu)
+{
+ return cpu->microblaze_cpu.spregs[0];
+}
+
+static void
+microblaze_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ cpu->microblaze_cpu.spregs[0] = pc;
+}
+
static void
free_state (SIM_DESC sd)
{
SIM_CPU *cpu = STATE_CPU (sd, i);
int osize = sim_memory_size;
+ CPU_PC_FETCH (cpu) = microblaze_pc_get;
+ CPU_PC_STORE (cpu) = microblaze_pc_set;
+
set_initial_gprs (cpu);
/* Discard and reacquire memory -- start with a clean slate. */
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (sh_pc_get, sh_pc_set): New functions.
+ (sim_open): Call CPU_PC_FETCH & CPU_PC_STORE for all cpus.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
}
}
+static sim_cia
+sh_pc_get (sim_cpu *cpu)
+{
+ return saved_state.asregs.pc;
+}
+
+static void
+sh_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ saved_state.asregs.pc = pc;
+}
+
static void
free_state (SIM_DESC sd)
{
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = sh_pc_get;
+ CPU_PC_STORE (cpu) = sh_pc_set;
+ }
+
for (p = argv + 1; *p != NULL; ++p)
{
if (isdigit (**p))