]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/m68hc11/interp.c
sim: arm/d10v/h8300/m68hc11/microblaze/mips/mn10300/moxie/sh/v850: convert to common...
[thirdparty/binutils-gdb.git] / sim / m68hc11 / interp.c
index bb93e6ca981d724cd534427d46f95d0fa0c325cd..7fb7005e94af673fef6130bfd49b05a72b4cc1b8 100644 (file)
@@ -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)