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/microblaze/interp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'sim/microblaze/interp.c') diff --git a/sim/microblaze/interp.c b/sim/microblaze/interp.c index 9e95e1e..aa8634e 100644 --- a/sim/microblaze/interp.c +++ b/sim/microblaze/interp.c @@ -633,6 +633,18 @@ sim_info (SIM_DESC sd, int verbose) (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) { @@ -706,6 +718,9 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv) 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. */ -- cgit v1.1