gas: sparc: fix collision of registers and pseudo-ops.
[deliverable/binutils-gdb.git] / sim / d10v / interp.c
index 70004296f68f0fbb19a0dd3c27e5d226a67ff228..cb8c6cf61f5c800c64624d810450f09e004b7b3b 100644 (file)
@@ -742,8 +742,12 @@ free_state (SIM_DESC sd)
   sim_state_free (sd);
 }
 
+static int d10v_reg_fetch (SIM_CPU *, int, unsigned char *, int);
+static int d10v_reg_store (SIM_CPU *, int, unsigned char *, int);
+
 SIM_DESC
-sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
+sim_open (SIM_OPEN_KIND kind, host_callback *cb,
+         struct bfd *abfd, char * const *argv)
 {
   struct simops *s;
   struct hash_entry *h;
@@ -766,9 +770,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
       return 0;
     }
 
-  /* getopt will print the error message so we just have to exit if this fails.
-     FIXME: Hmmm...  in the case of gdb we need getopt to call
-     print_filtered.  */
+  /* The parser will print an error message for us, so we silently return.  */
   if (sim_parse_args (sd, argv) != SIM_RC_OK)
     {
       free_state (sd);
@@ -806,6 +808,8 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
     {
       SIM_CPU *cpu = STATE_CPU (sd, i);
 
+      CPU_REG_FETCH (cpu) = d10v_reg_fetch;
+      CPU_REG_STORE (cpu) = d10v_reg_store;
       CPU_PC_FETCH (cpu) = d10v_pc_get;
       CPU_PC_STORE (cpu) = d10v_pc_set;
     }
@@ -856,7 +860,6 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb, struct bfd *abfd, char **argv)
   /* reset the processor state */
   if (!State.mem.data[0])
     sim_size (1);
-  sim_create_inferior ((SIM_DESC) 1, NULL, NULL, NULL);
 
   return sd;
 }
@@ -1139,7 +1142,8 @@ sim_info (SIM_DESC sd, int verbose)
 }
 
 SIM_RC
-sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env)
+sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
+                    char * const *argv, char * const *env)
 {
   bfd_vma start_address;
 
@@ -1197,10 +1201,10 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env)
   return SIM_RC_OK;
 }
 
-int
-sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
+static int
+d10v_reg_fetch (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
 {
-  SIM_CPU *cpu = STATE_CPU (sd, 0);
+  SIM_DESC sd = CPU_STATE (cpu);
   int size;
   switch ((enum sim_d10v_regs) rn)
     {
@@ -1281,10 +1285,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
+d10v_reg_store (SIM_CPU *cpu, int rn, unsigned char *memory, int length)
 {
-  SIM_CPU *cpu = STATE_CPU (sd, 0);
+  SIM_DESC sd = CPU_STATE (cpu);
   int size;
   switch ((enum sim_d10v_regs) rn)
     {
This page took 0.023711 seconds and 4 git commands to generate.