]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - sim/h8300/compile.c
sim: arm/cr16/d10v/h8300/microblaze/sh: fill out sim-cpu pc fetch/store helpers
[thirdparty/binutils-gdb.git] / sim / h8300 / compile.c
index e14c3ab625530f909d91447ccc76f8165ffb0113..d084b5d4de0a4227f239e3af64ea2d83b8dccbdd 100644 (file)
@@ -4865,6 +4865,18 @@ set_h8300h (unsigned long machine)
     h8300_normal_mode = 1;
 }
 
+static sim_cia
+h8300_pc_get (sim_cpu *cpu)
+{
+  return cpu->pc;
+}
+
+static void
+h8300_pc_set (sim_cpu *cpu, sim_cia pc)
+{
+  cpu->pc = pc;
+}
+
 /* Cover function of sim_state_free to free the cpu buffers as well.  */
 
 static void
@@ -4883,6 +4895,7 @@ sim_open (SIM_OPEN_KIND kind,
          struct bfd *abfd, 
          char **argv)
 {
+  int i;
   SIM_DESC sd;
   sim_cpu *cpu;
 
@@ -4947,6 +4960,15 @@ sim_open (SIM_OPEN_KIND kind,
       return 0;
     }
 
+  /* CPU specific initialization.  */
+  for (i = 0; i < MAX_NR_PROCESSORS; ++i)
+    {
+      SIM_CPU *cpu = STATE_CPU (sd, i);
+
+      CPU_PC_FETCH (cpu) = h8300_pc_get;
+      CPU_PC_STORE (cpu) = h8300_pc_set;
+    }
+
   /*  sim_hw_configure (sd); */
 
   /* FIXME: Much of the code in sim_load can be moved here.  */