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/cr16 | |
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/cr16')
-rw-r--r-- | sim/cr16/ChangeLog | 5 | ||||
-rw-r--r-- | sim/cr16/interp.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sim/cr16/ChangeLog b/sim/cr16/ChangeLog index 4aa6429..1a6cd14 100644 --- a/sim/cr16/ChangeLog +++ b/sim/cr16/ChangeLog @@ -1,3 +1,8 @@ +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. diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index 86fd280..6e31e1a 100644 --- a/sim/cr16/interp.c +++ b/sim/cr16/interp.c @@ -737,6 +737,18 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size) 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) { @@ -807,6 +819,15 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd, 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; |