aboutsummaryrefslogtreecommitdiff
path: root/sim/m68hc11
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-12-30 03:28:45 -0500
committerMike Frysinger <vapier@gentoo.org>2015-12-30 03:30:25 -0500
commite1211e55062594679697d2175b7ea77dad173823 (patch)
treefc4ef40e234adb3dc4072d112d9302ffcd6f4819 /sim/m68hc11
parentc78dff22918f29b3970729f32f70060b70e75678 (diff)
downloadgdb-e1211e55062594679697d2175b7ea77dad173823.zip
gdb-e1211e55062594679697d2175b7ea77dad173823.tar.gz
gdb-e1211e55062594679697d2175b7ea77dad173823.tar.bz2
sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert to common sim_{fetch,store}_register
Diffstat (limited to 'sim/m68hc11')
-rw-r--r--sim/m68hc11/ChangeLog9
-rw-r--r--sim/m68hc11/interp.c18
2 files changed, 18 insertions, 9 deletions
diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index 9fd9e28..ad83c37 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,12 @@
+2015-12-30 Mike Frysinger <vapier@gentoo.org>
+
+ * wrapper.c (m68hc11_reg_store, m68hc11_reg_fetch): Define.
+ (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE.
+ (sim_store_register): Rename to ...
+ (m68hc11_reg_store): ... this. Delete local cpu var.
+ (sim_fetch_register): Rename to ...
+ (m68hc11_reg_fetch): ... this. Delete local cpu var.
+
2015-12-27 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-hload.o.
diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c
index bb93e6c..7fb7005 100644
--- a/sim/m68hc11/interp.c
+++ b/sim/m68hc11/interp.c
@@ -413,6 +413,9 @@ m68hc11_pc_set (sim_cpu *cpu, sim_cia pc)
cpu_set_pc (cpu, pc);
}
+static int m68hc11_reg_fetch (SIM_CPU *, int, unsigned char *, int);
+static int m68hc11_reg_store (SIM_CPU *, int, unsigned char *, int);
+
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *callback,
bfd *abfd, char **argv)
@@ -492,6 +495,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback,
{
SIM_CPU *cpu = STATE_CPU (sd, i);
+ CPU_REG_FETCH (cpu) = m68hc11_reg_fetch;
+ CPU_REG_STORE (cpu) = m68hc11_reg_store;
CPU_PC_FETCH (cpu) = m68hc11_pc_get;
CPU_PC_STORE (cpu) = m68hc11_pc_set;
}
@@ -553,14 +558,12 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
return sim_prepare_for_program (sd, abfd);
}
-int
-sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
+static int
+m68hc11_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
- sim_cpu *cpu;
uint16 val;
int size = 2;
- cpu = STATE_CPU (sd, 0);
switch (rn)
{
case A_REGNUM:
@@ -619,13 +622,10 @@ sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
return size;
}
-int
-sim_store_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
+static int
+m68hc11_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
uint16 val;
- sim_cpu *cpu;
-
- cpu = STATE_CPU (sd, 0);
val = *memory++;
if (length == 2)