aboutsummaryrefslogtreecommitdiff
path: root/sim/m68hc11/interp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/m68hc11/interp.c')
-rw-r--r--sim/m68hc11/interp.c18
1 files changed, 9 insertions, 9 deletions
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)