From 27b97b40bca216097d16d53fa9408a70cd281479 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 17 Apr 2015 02:16:10 -0400 Subject: sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpers This makes the common sim-cpu logic work. --- sim/h8300/ChangeLog | 7 +++++++ sim/h8300/compile.c | 22 ++++++++++++++++++++++ sim/h8300/sim-main.h | 2 ++ 3 files changed, 31 insertions(+) (limited to 'sim/h8300') diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog index eaf3088..f414847 100644 --- a/sim/h8300/ChangeLog +++ b/sim/h8300/ChangeLog @@ -1,3 +1,10 @@ +2015-04-17 Mike Frysinger + + * 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 * Makefile.in (SIM_OBJS): Delete sim-cpu.o. diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c index e14c3ab..d084b5d 100644 --- a/sim/h8300/compile.c +++ b/sim/h8300/compile.c @@ -4865,6 +4865,18 @@ set_h8300h (unsigned long machine) 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 @@ -4883,6 +4895,7 @@ sim_open (SIM_OPEN_KIND kind, struct bfd *abfd, char **argv) { + int i; SIM_DESC sd; sim_cpu *cpu; @@ -4947,6 +4960,15 @@ sim_open (SIM_OPEN_KIND kind, 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. */ diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h index 8b07505..e428d80 100644 --- a/sim/h8300/sim-main.h +++ b/sim/h8300/sim-main.h @@ -91,6 +91,8 @@ enum h8_typecodes { /* Define sim_cia. */ typedef unsigned32 sim_cia; +typedef struct _sim_cpu SIM_CPU; + #include "sim-base.h" /* Structure used to describe addressing */ -- cgit v1.1