aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300
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/h8300
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/h8300')
-rw-r--r--sim/h8300/ChangeLog7
-rw-r--r--sim/h8300/compile.c22
-rw-r--r--sim/h8300/sim-main.h2
3 files changed, 31 insertions, 0 deletions
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index eaf3088..f414847 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,10 @@
+2015-04-17 Mike Frysinger <vapier@gentoo.org>
+
+ * compile.c (h8300_pc_get, h8300_pc_set): New functions.
+ (sim_open): Declare new local var i. Call CPU_PC_FETCH &
+ CPU_PC_STORE for all cpus.
+ * sim-main.h (SIM_CPU): Define.
+
2015-04-15 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-cpu.o.
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index e14c3ab..d084b5d 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -4865,6 +4865,18 @@ set_h8300h (unsigned long machine)
h8300_normal_mode = 1;
}
+static sim_cia
+h8300_pc_get (sim_cpu *cpu)
+{
+ return cpu->pc;
+}
+
+static void
+h8300_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+ cpu->pc = pc;
+}
+
/* Cover function of sim_state_free to free the cpu buffers as well. */
static void
@@ -4883,6 +4895,7 @@ sim_open (SIM_OPEN_KIND kind,
struct bfd *abfd,
char **argv)
{
+ int i;
SIM_DESC sd;
sim_cpu *cpu;
@@ -4947,6 +4960,15 @@ sim_open (SIM_OPEN_KIND kind,
return 0;
}
+ /* CPU specific initialization. */
+ for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+ {
+ SIM_CPU *cpu = STATE_CPU (sd, i);
+
+ CPU_PC_FETCH (cpu) = h8300_pc_get;
+ CPU_PC_STORE (cpu) = h8300_pc_set;
+ }
+
/* sim_hw_configure (sd); */
/* FIXME: Much of the code in sim_load can be moved here. */
diff --git a/sim/h8300/sim-main.h b/sim/h8300/sim-main.h
index 8b07505..e428d80 100644
--- a/sim/h8300/sim-main.h
+++ b/sim/h8300/sim-main.h
@@ -91,6 +91,8 @@ enum h8_typecodes {
/* Define sim_cia. */
typedef unsigned32 sim_cia;
+typedef struct _sim_cpu SIM_CPU;
+
#include "sim-base.h"
/* Structure used to describe addressing */