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/sh | |
parent | 0fdc66e16e44210dd7468eb78a9c658d6f0b2b65 (diff) | |
download | gdb-27b97b40bca216097d16d53fa9408a70cd281479.zip gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.gz gdb-27b97b40bca216097d16d53fa9408a70cd281479.tar.bz2 |
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/sh')
-rw-r--r-- | sim/sh/ChangeLog | 5 | ||||
-rw-r--r-- | sim/sh/interp.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog index 9b5c69e..fc359ed 100644 --- a/sim/sh/ChangeLog +++ b/sim/sh/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 13f6e65..2f02e69 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -2373,6 +2373,18 @@ sim_info (SIM_DESC sd, int verbose) } } +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) { @@ -2448,6 +2460,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) = sh_pc_get; + CPU_PC_STORE (cpu) = sh_pc_set; + } + for (p = argv + 1; *p != NULL; ++p) { if (isdigit (**p)) |