diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-04-17 02:16:10 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-04-17 02:22:16 -0400 |
commit | 27b97b40bca216097d16d53fa9408a70cd281479 (patch) | |
tree | b31d55346eb233bc7b163602fdc3339a417923b1 /sim/d10v | |
parent | Automatic date update in version.in (diff) | |
download | binutils-gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.gz binutils-gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.bz2 binutils-gdb-27b97b40bca216097d16d53fa9408a70cd281479.zip |
sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpers
This makes the common sim-cpu logic work.
Diffstat (limited to 'sim/d10v')
-rw-r--r-- | sim/d10v/ChangeLog | 6 | ||||
-rw-r--r-- | sim/d10v/interp.c | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sim/d10v/ChangeLog b/sim/d10v/ChangeLog index 4ce1df84aa5..0cf06d7b6d0 100644 --- a/sim/d10v/ChangeLog +++ b/sim/d10v/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 7fc0745e35b..b9755614423 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -722,6 +722,18 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size) 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) { @@ -740,6 +752,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) 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); @@ -791,6 +804,15 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) 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; |