aboutsummaryrefslogtreecommitdiff
path: root/sim/v850
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/v850
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/v850')
-rw-r--r--sim/v850/ChangeLog9
-rw-r--r--sim/v850/interp.c21
2 files changed, 19 insertions, 11 deletions
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index e09ad1a..2b66488 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,12 @@
+2015-12-30 Mike Frysinger <vapier@gentoo.org>
+
+ * wrapper.c (v850_reg_store, v850_reg_fetch): Define.
+ (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE.
+ (sim_store_register): Rename to ...
+ (v850_reg_store): ... this.
+ (sim_fetch_register): Rename to ...
+ (v850_reg_fetch): ... this.
+
2015-12-27 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (SIM_OBJS): Delete sim-hload.o.
diff --git a/sim/v850/interp.c b/sim/v850/interp.c
index f055149..422d926 100644
--- a/sim/v850/interp.c
+++ b/sim/v850/interp.c
@@ -188,6 +188,9 @@ v850_pc_set (sim_cpu *cpu, sim_cia pc)
PC = pc;
}
+static int v850_reg_fetch (SIM_CPU *, int, unsigned char *, int);
+static int v850_reg_store (SIM_CPU *, int, unsigned char *, int);
+
SIM_DESC
sim_open (SIM_OPEN_KIND kind,
host_callback * cb,
@@ -296,6 +299,8 @@ sim_open (SIM_OPEN_KIND kind,
{
SIM_CPU *cpu = STATE_CPU (sd, i);
+ CPU_REG_FETCH (cpu) = v850_reg_fetch;
+ CPU_REG_STORE (cpu) = v850_reg_store;
CPU_PC_FETCH (cpu) = v850_pc_get;
CPU_PC_STORE (cpu) = v850_pc_set;
}
@@ -315,21 +320,15 @@ sim_create_inferior (SIM_DESC sd,
return SIM_RC_OK;
}
-int
-sim_fetch_register (SIM_DESC sd,
- int rn,
- unsigned char * memory,
- int length)
+static int
+v850_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
*(unsigned32*)memory = H2T_4 (State.regs[rn]);
return -1;
}
-
-int
-sim_store_register (SIM_DESC sd,
- int rn,
- unsigned char * memory,
- int length)
+
+static int
+v850_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
State.regs[rn] = T2H_4 (*(unsigned32 *) memory);
return length;