]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/cr16/interp.c
sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpers
[thirdparty/binutils-gdb.git] / sim / cr16 / interp.c
index 86fd28081a00500b5b0bbfeead1f325f25c3aa07..6e31e1a51c422ed0f18804518df02745d99523fe 100644 (file)
@@ -737,6 +737,18 @@ sim_read (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size)
   return xfer_mem (sd, addr, buffer, size, 0);
 }
 
+static sim_cia
+cr16_pc_get (sim_cpu *cpu)
+{
+  return PC;
+}
+
+static void
+cr16_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+  SET_PC (pc);
+}
+
 static void
 free_state (SIM_DESC sd)
 {
@@ -807,6 +819,15 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd,
       return 0;
     }
 
+  /* CPU specific initialization.  */
+  for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+    {
+      SIM_CPU *cpu = STATE_CPU (sd, i);
+
+      CPU_PC_FETCH (cpu) = cr16_pc_get;
+      CPU_PC_STORE (cpu) = cr16_pc_set;
+    }
+
   trace_sd = sd;
   cr16_callback = cb;