aboutsummaryrefslogtreecommitdiff
path: root/sim/mn10300
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/mn10300
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/mn10300')
-rw-r--r--sim/mn10300/ChangeLog9
-rw-r--r--sim/mn10300/interp.c19
2 files changed, 18 insertions, 10 deletions
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index a159aa4..d59a7e8 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,12 @@
+2015-12-30 Mike Frysinger <vapier@gentoo.org>
+
+ * wrapper.c (mn10300_reg_store, mn10300_reg_fetch): Define.
+ (sim_open): Call CPU_REG_FETCH/CPU_REG_STORE.
+ (sim_store_register): Rename to ...
+ (mn10300_reg_store): ... this.
+ (sim_fetch_register): Rename to ...
+ (mn10300_reg_fetch): ... this.
+
2015-12-27 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (MN10300_OBJS): Delete sim-hload.o.
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index 4940acc..8550c45 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -86,6 +86,9 @@ mn10300_pc_set (sim_cpu *cpu, sim_cia pc)
PC = pc;
}
+static int mn10300_reg_fetch (SIM_CPU *, int, unsigned char *, int);
+static int mn10300_reg_store (SIM_CPU *, int, unsigned char *, int);
+
/* These default values correspond to expected usage for the chip. */
SIM_DESC
@@ -308,6 +311,8 @@ sim_open (SIM_OPEN_KIND kind,
{
SIM_CPU *cpu = STATE_CPU (sd, i);
+ CPU_REG_FETCH (cpu) = mn10300_reg_fetch;
+ CPU_REG_STORE (cpu) = mn10300_reg_store;
CPU_PC_FETCH (cpu) = mn10300_pc_get;
CPU_PC_STORE (cpu) = mn10300_pc_set;
}
@@ -338,11 +343,8 @@ sim_create_inferior (SIM_DESC sd,
/* FIXME These would more efficient to use than load_mem/store_mem,
but need to be changed to use the memory map. */
-int
-sim_fetch_register (SIM_DESC sd,
- int rn,
- unsigned char *memory,
- int length)
+static int
+mn10300_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
reg_t reg = State.regs[rn];
uint8 *a = memory;
@@ -353,11 +355,8 @@ sim_fetch_register (SIM_DESC sd,
return length;
}
-int
-sim_store_register (SIM_DESC sd,
- int rn,
- unsigned char *memory,
- int length)
+static int
+mn10300_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
{
uint8 *a = memory;
State.regs[rn] = (a[3] << 24) + (a[2] << 16) + (a[1] << 8) + a[0];