aboutsummaryrefslogtreecommitdiff
path: root/sim/microblaze
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-04-17 02:16:10 -0400
committerMike Frysinger <vapier@gentoo.org>2015-04-17 02:22:16 -0400
commit27b97b40bca216097d16d53fa9408a70cd281479 (patch)
treeb31d55346eb233bc7b163602fdc3339a417923b1 /sim/microblaze
parent0fdc66e16e44210dd7468eb78a9c658d6f0b2b65 (diff)
downloadgdb-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/microblaze')
-rw-r--r--sim/microblaze/ChangeLog5
-rw-r--r--sim/microblaze/interp.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/sim/microblaze/ChangeLog b/sim/microblaze/ChangeLog
index 9fd188c..4223301 100644
--- a/sim/microblaze/ChangeLog
+++ b/sim/microblaze/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * interp.c (microblaze_pc_get, microblaze_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/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. */