Use __asm__ rather than asm in gold testsuite
[deliverable/binutils-gdb.git] / sim / cr16 / interp.c
index 8925d856de13ca3e8b0480005b13f1860fe6ddf9..aa03a1b23a24402ff00f54785a30d3c6f38dab5e 100644 (file)
@@ -1,5 +1,5 @@
 /* Simulation code for the CR16 processor.
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2020 Free Software Foundation, Inc.
    Contributed by M Ranga Swami Reddy <MR.Swami.Reddy@nsc.com>
 
    This file is part of GDB, the GNU debugger.
@@ -35,8 +35,6 @@
 
 int cr16_debug;
 
-host_callback *cr16_callback;
-
 uint32 OP[4];
 uint32 sign_flag;
 
@@ -326,12 +324,11 @@ get_operands (operand_desc *s, uint64 ins, int isize, int nops)
 static int
 do_run (SIM_DESC sd, SIM_CPU *cpu, uint64 mcode)
 {
-  host_callback *cr16_callback = STATE_CALLBACK (sd);
   struct hash_entry *h;
 
 #ifdef DEBUG
   if ((cr16_debug & DEBUG_INSTRUCTION) != 0)
-    (*cr16_callback->printf_filtered) (cr16_callback, "do_long 0x%x\n", mcode);
+    sim_io_printf (sd, "do_long 0x%x\n", mcode);
 #endif
 
    h = lookup_hash (sd, cpu, mcode, 1);
@@ -386,7 +383,8 @@ static int cr16_reg_fetch (SIM_CPU *, int, unsigned char *, int);
 static int cr16_reg_store (SIM_CPU *, int, unsigned char *, int);
 
 SIM_DESC
-sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd, char **argv)
+sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb,
+         struct bfd *abfd, char * const *argv)
 {
   struct simops *s;
   struct hash_entry *h;
@@ -409,9 +407,7 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd,
       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);
@@ -463,8 +459,6 @@ sim_open (SIM_OPEN_KIND kind, struct host_callback_struct *cb, struct bfd *abfd,
      but it matches what the toolchain currently expects.  Ugh.  */
   sim_do_commandf (sd, "memory-size %#x", 20 * 1024 * 1024);
 
-  cr16_callback = cb;
-
   /* put all the opcodes in the hash table.  */
   if (!init_p++)
     {
@@ -585,7 +579,7 @@ step_once (SIM_DESC sd, SIM_CPU *cpu)
   curr_ins_size = do_run (sd, cpu, mcode);
 
 #if CR16_DEBUG
-  (*cr16_callback->printf_filtered) (cr16_callback, "INS: PC=0x%X, mcode=0x%X\n", PC, mcode);
+  sim_io_printf (sd, "INS: PC=0x%X, mcode=0x%X\n", PC, mcode);
 #endif
 
   if (curr_ins_size == 0)
@@ -652,7 +646,8 @@ sim_engine_run (SIM_DESC sd,
 }
 
 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;
 
@@ -674,7 +669,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char **argv, char **env)
     start_address = 0x0;
 #ifdef DEBUG
   if (cr16_debug)
-    (*cr16_callback->printf_filtered) (cr16_callback, "sim_create_inferior:  PC=0x%lx\n", (long) start_address);
+    sim_io_printf (sd, "sim_create_inferior:  PC=0x%lx\n", (long) start_address);
 #endif
   {
     SIM_CPU *cpu = STATE_CPU (sd, 0);
This page took 0.02401 seconds and 4 git commands to generate.