OSDN Git Service

2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>
authorcagney <cagney>
Thu, 27 Jul 2000 11:49:04 +0000 (11:49 +0000)
committercagney <cagney>
Thu, 27 Jul 2000 11:49:04 +0000 (11:49 +0000)
        * nrun.c (main): Print the simulator statistics only in
        verbose mode.
        * hw-properties.h (hw_find_integer_array_property): Fix
        prototype (use signed_cell).

sim/common/ChangeLog
sim/common/hw-properties.h
sim/common/nrun.c

index eb07b92..ef7b8eb 100644 (file)
@@ -1,6 +1,12 @@
 Thu Jul 27 20:37:47 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        From 2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
+       * nrun.c (main): Print the simulator statistics only in
+       verbose mode.
+       * hw-properties.h (hw_find_integer_array_property): Fix
+       prototype (use signed_cell).
+
+       From 2000-06-25 Stephane Carrez <Stephane.Carrez@worldnet.fr>:
        * sim-events.c (sim_events_remain_time): New function returning
        the time that remains before the event is raised.
        * hw-events.c (hw_event_remain_time): Likewise.
index 511fba3..198878f 100644 (file)
@@ -166,7 +166,7 @@ int hw_find_integer_array_property
 (struct hw *me,
  const char *property,
  unsigned index,
- signed_word *integer);
+ signed_cell *integer);
 
 
 
index 42be33e..ef25d68 100644 (file)
@@ -137,41 +137,45 @@ main (int argc, char **argv)
             ((reason == sim_stopped) && 
              (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT)));
     }
-  else do
+  else 
     {
+      do
+       {
 #if defined (HAVE_SIGACTION) && defined (SA_RESTART)
-      struct sigaction sa, osa;
-      sa.sa_handler = cntrl_c;
-      sigemptyset (&sa.sa_mask);
-      sa.sa_flags = 0;
-      sigaction (SIGINT, &sa, &osa);
-      prev_sigint = osa.sa_handler;
+         struct sigaction sa, osa;
+         sa.sa_handler = cntrl_c;
+         sigemptyset (&sa.sa_mask);
+         sa.sa_flags = 0;
+         sigaction (SIGINT, &sa, &osa);
+         prev_sigint = osa.sa_handler;
 #else
-      prev_sigint = signal (SIGINT, cntrl_c);
+         prev_sigint = signal (SIGINT, cntrl_c);
 #endif
-      sim_resume (sd, 0, sigrc);
-      signal (SIGINT, prev_sigint);
-      sim_stop_reason (sd, &reason, &sigrc);
-
-      if ((reason == sim_stopped) &&
-         (sigrc == sim_signal_to_host (sd, SIM_SIGINT)))
-       break; /* exit on control-C */
-
-      /* remain on signals in oe mode */
-    } while ((reason == sim_stopped) &&
-            (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT));
-
+         sim_resume (sd, 0, sigrc);
+         signal (SIGINT, prev_sigint);
+         sim_stop_reason (sd, &reason, &sigrc);
+         
+         if ((reason == sim_stopped) &&
+             (sigrc == sim_signal_to_host (sd, SIM_SIGINT)))
+           break; /* exit on control-C */
+         
+         /* remain on signals in oe mode */
+       } while ((reason == sim_stopped) &&
+                (STATE_ENVIRONMENT (sd) == OPERATING_ENVIRONMENT));
+      
+    }
   /* Print any stats the simulator collected.  */
-  sim_info (sd, 0);
-
+  if (STATE_VERBOSE_P (sd))
+    sim_info (sd, 0);
+  
   /* Shutdown the simulator.  */
   sim_close (sd, 0);
-
+  
   /* If reason is sim_exited, then sigrc holds the exit code which we want
      to return.  If reason is sim_stopped or sim_signalled, then sigrc holds
      the signal that the simulator received; we want to return that to
      indicate failure.  */
-
+  
 #ifdef SIM_H8300 /* FIXME: Ugh.  grep for SLEEP in compile.c  */
   if (sigrc == SIGILL)
     abort ();
@@ -206,9 +210,3 @@ usage ()
   fprintf (stderr, "Run `%s --help' for full list of options.\n", myname);
   exit (1);
 }
-
-
-#ifdef __CYGWIN32__
-/* no-op GUI update hook for standalone sim */
-void (*ui_loop_hook) PARAMS ((int)) = NULL;
-#endif