OSDN Git Service

Index: arm/ChangeLog
authorcagney <cagney>
Thu, 27 Feb 2003 23:26:33 +0000 (23:26 +0000)
committercagney <cagney>
Thu, 27 Feb 2003 23:26:33 +0000 (23:26 +0000)
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* wrapper.c (sim_create_inferior, sim_open): Rename _bfd to bfd.

Index: common/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* sim-utils.h (sim_analyze_program, sim_load_file): Rename _bfd to bfd.
* sim-hload.c (sim_load), sim-base.h (sim_state_base): Ditto.
* nrun.c (main): Ditto.

Index: d10v/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: erc32/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interf.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: h8300/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: h8500/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: i960/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: m32r/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: m68hc11/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_prepare_for_program, sim_open)
(sim_create_inferior): Rename _bfd to bfd.

Index: mcore/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: mips/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_open):
(sim_create_inferior):

Index: mn10200/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: mn10300/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_open, sim_create_inferior, sim_open)
(sim_create_inferior): Rename _bfd to bfd.

Index: ppc/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* sim_calls.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: sh/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (init_dsp, sim_open, sim_create_inferior): Rename _bfd
to bfd.

Index: v850/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

Index: z8k/ChangeLog
2003-02-27  Andrew Cagney  <cagney@redhat.com>

* iface.c (sim_open, sim_create_inferior): Rename _bfd to bfd.

37 files changed:
sim/arm/ChangeLog
sim/arm/wrapper.c
sim/common/ChangeLog
sim/common/nrun.c
sim/common/sim-base.h
sim/common/sim-hload.c
sim/common/sim-utils.h
sim/d10v/ChangeLog
sim/d10v/interp.c
sim/erc32/ChangeLog
sim/erc32/interf.c
sim/h8300/ChangeLog
sim/h8300/compile.c
sim/h8500/ChangeLog
sim/h8500/compile.c
sim/i960/ChangeLog
sim/i960/sim-if.c
sim/m32r/ChangeLog
sim/m32r/sim-if.c
sim/m68hc11/ChangeLog
sim/m68hc11/interp.c
sim/mcore/ChangeLog
sim/mcore/interp.c
sim/mips/ChangeLog
sim/mips/interp.c
sim/mn10200/ChangeLog
sim/mn10200/interp.c
sim/mn10300/ChangeLog
sim/mn10300/interp.c
sim/ppc/ChangeLog
sim/ppc/sim_calls.c
sim/sh/ChangeLog
sim/sh/interp.c
sim/v850/ChangeLog
sim/v850/interp.c
sim/z8k/ChangeLog
sim/z8k/iface.c

index ca21f15..90cc64f 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * wrapper.c (sim_create_inferior, sim_open): Rename _bfd to bfd.
+       
 2003-01-10  Ben Elliston  <bje@redhat.com>
 
        * README.Cygnus: Rename from this ..
index 262e2e7..244c475 100644 (file)
@@ -204,7 +204,7 @@ sim_resume (sd, step, siggnal)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, env)
      SIM_DESC sd ATTRIBUTE_UNUSED;
-     struct _bfd * abfd;
+     struct bfd * abfd;
      char ** argv;
      char ** env;
 {
@@ -610,7 +610,7 @@ SIM_DESC
 sim_open (kind, ptr, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *ptr;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   sim_kind = kind;
index bd1b29b..daadcf6 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * sim-utils.h (sim_analyze_program, sim_load_file): Rename _bfd to bfd.
+       * sim-hload.c (sim_load), sim-base.h (sim_state_base): Ditto.
+       * nrun.c (main): Ditto.
+
 2003-02-26  Andrew Cagney  <cagney@redhat.com>
 
        * sim-engine.h (sim_engine_abort): Add noreturn attribute.
index ef25d68..7c77f5c 100644 (file)
@@ -47,7 +47,7 @@ main (int argc, char **argv)
 {
   char *name;
   char **prog_argv = NULL;
-  struct _bfd *prog_bfd;
+  struct bfd *prog_bfd;
   enum sim_stop reason;
   int sigrc = 0;
   int single_step = 0;
index 1fbd9b2..3f702f6 100644 (file)
@@ -171,7 +171,7 @@ typedef struct {
 #define STATE_PROG_ARGV(sd) ((sd)->base.prog_argv)
 
   /* The program's bfd.  */
-  struct _bfd *prog_bfd;
+  struct bfd *prog_bfd;
 #define STATE_PROG_BFD(sd) ((sd)->base.prog_bfd)
 
   /* Symbol table for prog_bfd */
index e4016f4..07a608b 100644 (file)
@@ -31,7 +31,7 @@ SIM_RC
 sim_load (sd, prog_name, prog_bfd, from_tty)
      SIM_DESC sd;
      char *prog_name;
-     struct _bfd *prog_bfd;
+     struct bfd *prog_bfd;
      int from_tty;
 {
   bfd *result_bfd;
@@ -45,20 +45,14 @@ sim_load (sd, prog_name, prog_bfd, from_tty)
      incorrectly write the program sections at LMA interpreted as a
      virtual address.  This is still accommodated for backward
      compatibility reasons. */
-  /* FIXME: The following simulators use this file as of 980313:
-     m32r, mips, v850 [grep for sim-hload in all Makefile.in's].
-     Each of these should be properly using lma.  When this is confirmed,
-     SIM_HANDLES_LMA can go away.  */
-#ifndef SIM_HANDLES_LMA
-#define SIM_HANDLES_LMA 0
-#endif
 
   result_bfd = sim_load_file (sd, STATE_MY_NAME (sd),
                              STATE_CALLBACK (sd),
                              prog_name,
                              STATE_PROG_BFD (sd),
                              STATE_OPEN_KIND (sd) == SIM_OPEN_DEBUG,
-                             SIM_HANDLES_LMA, sim_write);
+                             STATE_LOAD_AT_LMA_P (sd),
+                             sim_write);
   if (result_bfd == NULL)
     {
       bfd_close (STATE_PROG_BFD (sd));
index 8e80e6a..661ac70 100644 (file)
@@ -49,7 +49,7 @@ unsigned long sim_elapsed_time_since (SIM_ELAPSED_TIME start);
 /* Utilities for manipulating the load image.  */
 
 SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
-                           struct _bfd *prog_bfd);
+                           struct bfd *prog_bfd);
 
 /* Load program PROG into the simulator using the function DO_LOAD.
    If PROG_BFD is non-NULL, the file has already been opened.
@@ -65,10 +65,10 @@ SIM_RC sim_analyze_program (SIM_DESC sd, char *prog_name,
 
 typedef int sim_write_fn PARAMS ((SIM_DESC sd, SIM_ADDR mem,
                                      unsigned char *buf, int length));
-struct _bfd *sim_load_file (SIM_DESC sd, const char *myname,
-                           host_callback *callback, char *prog,
-                           struct _bfd *prog_bfd, int verbose_p,
-                           int lma_p, sim_write_fn do_load);
+struct bfd *sim_load_file (SIM_DESC sd, const char *myname,
+                          host_callback *callback, char *prog,
+                          struct bfd *prog_bfd, int verbose_p,
+                          int lma_p, sim_write_fn do_load);
 
 /* Internal version of sim_do_command, include formatting */
 void sim_do_commandf (SIM_DESC sd, const char *fmt, ...);
index 9c42d35..54d84e6 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-11-13  Andrew Cagney  <cagney@redhat.com>
 
        * simops.c: Include <string.h>.
index 0f7295d..718acca 100644 (file)
@@ -788,7 +788,7 @@ SIM_DESC
 sim_open (kind, callback, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *callback;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   struct simops *s;
@@ -1194,7 +1194,7 @@ sim_info (sd, verbose)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {
index 92b2950..5bf54d7 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interf.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index 1931886..9d59471 100644 (file)
@@ -184,7 +184,7 @@ SIM_DESC
 sim_open (kind, callback, abfd, argv)
      SIM_OPEN_KIND kind;
      struct host_callback_struct *callback;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
 
@@ -304,7 +304,7 @@ sim_load(sd, prog, abfd, from_tty)
 SIM_RC
 sim_create_inferior(sd, abfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {
index 2753416..0e62569 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2003-02-05  Kazu Hirata  <kazu@cs.umass.edu>
 
        * compile.c (init_pointers): Abort if wreg never gets initialized.
index 2a066a3..cd60b86 100644 (file)
@@ -2125,7 +2125,7 @@ set_h8300h (int h_flag, int s_flag)
 SIM_DESC
 sim_open (SIM_OPEN_KIND kind, 
          struct host_callback_struct *ptr, 
-         struct _bfd *abfd, 
+         struct bfd *abfd, 
          char **argv)
 {
   /* FIXME: Much of the code in sim_load can be moved here.  */
@@ -2228,7 +2228,7 @@ sim_load (SIM_DESC sd, char *prog, bfd *abfd, int from_tty)
 }
 
 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 **argv, char **env)
 {
   if (abfd != NULL)
     cpu.pc = bfd_get_start_address (abfd);
index d42834c..fe72e49 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index aec8ce9..5db2bee 100644 (file)
@@ -2443,7 +2443,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   sim_kind = kind;
@@ -2484,7 +2484,7 @@ sim_load (sd, prog, abfd, from_tty)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {
index 6a727fe..1f61c31 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index 3a58548..423dac0 100644 (file)
@@ -31,7 +31,7 @@ static void free_state (SIM_DESC);
    disassembler.  */
 static CGEN_DISASSEMBLER i960_disassemble_insn;
 
-/* Records simulator descriptor so utilities like m32r_dump_regs can be
+/* Records simulator descriptor so utilities like i960_dump_regs can be
    called from gdb.  */
 SIM_DESC current_state;
 \f
@@ -52,7 +52,7 @@ SIM_DESC
 sim_open (kind, callback, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *callback;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   char c;
@@ -145,8 +145,8 @@ sim_open (kind, callback, abfd, argv)
 
   /* Open a copy of the cpu descriptor table.  */
   {
-    CGEN_CPU_DESC cd = i960_cgen_cpu_open (STATE_ARCHITECTURE (sd)->mach,
-                                          CGEN_ENDIAN_LITTLE);
+    CGEN_CPU_DESC cd = i960_cgen_cpu_open_1 (STATE_ARCHITECTURE (sd)->printable_name,
+                                            CGEN_ENDIAN_LITTLE);
     for (i = 0; i < MAX_NR_PROCESSORS; ++i)
       {
        SIM_CPU *cpu = STATE_CPU (sd, i);
@@ -156,10 +156,10 @@ sim_open (kind, callback, abfd, argv)
   }
 
   /* Initialize various cgen things not done by common framework.
-     Must be done after m32r_cgen_cpu_open.  */
+     Must be done after i960_cgen_cpu_open.  */
   cgen_init (sd);
 
-  /* Store in a global so things like sparc32_dump_regs can be invoked
+  /* Store in a global so things like i960_dump_regs can be invoked
      from the gdb command line.  */
   current_state = sd;
 
@@ -178,7 +178,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, envp)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **envp;
 {
index 532e024..b4097db 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * sim-if.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-12-19  Doug Evans  <dje@sebabeach.org>
 
        * arch.c,arch.h,cpuall.h: Regenerate.
index 6116af8..95568cc 100644 (file)
@@ -56,7 +56,7 @@ SIM_DESC
 sim_open (kind, callback, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *callback;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   SIM_DESC sd = sim_state_alloc (kind, callback);
@@ -155,8 +155,8 @@ sim_open (kind, callback, abfd, argv)
 
   /* Open a copy of the cpu descriptor table.  */
   {
-    CGEN_CPU_DESC cd = m32r_cgen_cpu_open (STATE_ARCHITECTURE (sd)->mach,
-                                          CGEN_ENDIAN_BIG);
+    CGEN_CPU_DESC cd = m32r_cgen_cpu_open_1 (STATE_ARCHITECTURE (sd)->printable_name,
+                                            CGEN_ENDIAN_BIG);
     for (i = 0; i < MAX_NR_PROCESSORS; ++i)
       {
        SIM_CPU *cpu = STATE_CPU (sd, i);
@@ -199,7 +199,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, envp)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **envp;
 {
@@ -235,6 +235,11 @@ print_m32r_misc_cpu (SIM_CPU *cpu, int verbose)
                     PROFILE_LABEL_WIDTH, "Fill nops:",
                     sim_add_commas (buf, sizeof (buf),
                                     CPU_M32R_MISC_PROFILE (cpu)->fillnop_count));
+      if (STATE_ARCHITECTURE (sd)->mach == bfd_mach_m32rx)
+       sim_io_printf (sd, "  %-*s %s\n\n",
+                      PROFILE_LABEL_WIDTH, "Parallel insns:",
+                      sim_add_commas (buf, sizeof (buf),
+                                      CPU_M32R_MISC_PROFILE (cpu)->parallel_count));
     }
 }
 
index abe5f55..325b887 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_prepare_for_program, sim_open)
+       (sim_create_inferior): Rename _bfd to bfd.
+
 2002-08-13  Stephane Carrez  <stcarrez@nerim.fr>
 
        * dv-m68hc11eepr.c (struct m68hc11eepr ): Use const char* for filename.
index 74674ce..8a60606 100644 (file)
@@ -295,7 +295,7 @@ sim_hw_configure (SIM_DESC sd)
 }
 
 static int
-sim_prepare_for_program (SIM_DESC sd, struct _bfd* abfd)
+sim_prepare_for_program (SIM_DESC sd, struct bfd* abfd)
 {
   sim_cpu *cpu;
 
@@ -341,7 +341,7 @@ sim_prepare_for_program (SIM_DESC sd, struct _bfd* abfd)
 
 SIM_DESC
 sim_open (SIM_OPEN_KIND kind, host_callback *callback,
-          struct _bfd *abfd, char **argv)
+          struct bfd *abfd, char **argv)
 {
   SIM_DESC sd;
   sim_cpu *cpu;
@@ -486,7 +486,7 @@ sim_info (SIM_DESC sd, int verbose)
 }
 
 SIM_RC
-sim_create_inferior (SIM_DESC sd, struct _bfd *abfd,
+sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
                      char **argv, char **env)
 {
   return sim_prepare_for_program (sd, abfd);
index afa841f..be79bec 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index 79c7d2e..bf04ed9 100644 (file)
@@ -1901,7 +1901,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback * cb;
-     struct _bfd * abfd;
+     struct bfd * abfd;
      char ** argv;
 {
   int osize = sim_memory_size;
@@ -2009,7 +2009,7 @@ sim_load (sd, prog, abfd, from_tty)
 SIM_RC
 sim_create_inferior (sd, prog_bfd, argv, env)
      SIM_DESC sd;
-     struct _bfd * prog_bfd;
+     struct bfd * prog_bfd;
      char ** argv;
      char ** env;
 {
index 0482ab2..76c676c 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_open): 
+       (sim_create_inferior): 
+
 2003-01-14  Chris Demetriou  <cgd@broadcom.com>
 
        * mips.igen (LUXC1, SUXC1): New, for mipsV and mips64.
index b2828e0..f8c14c8 100644 (file)
@@ -326,7 +326,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   SIM_DESC sd = sim_state_alloc (kind, cb);
@@ -971,7 +971,7 @@ sim_fetch_register (sd,rn,memory,length)
 SIM_RC
 sim_create_inferior (sd, abfd, argv,env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {
index 8a539c5..090b05c 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index df95b7c..ea4e04f 100644 (file)
@@ -4,6 +4,17 @@
 
 #include "mn10200_sim.h"
 
+#ifdef NEED_UI_LOOP_HOOK
+/* How often to run the ui_loop update, when in use */
+#define UI_LOOP_POLL_INTERVAL 0x60000
+
+/* Counter for the ui_loop_hook update */
+static long ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
+
+/* Actual hook to call to run through gdb's gui event loop */
+extern int (*ui_loop_hook) (int);
+#endif /* NEED_UI_LOOP_HOOK */
+
 host_callback *mn10200_callback;
 int mn10200_debug;
 static SIM_OPEN_KIND sim_kind;
@@ -200,7 +211,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   struct simops *s;
@@ -292,7 +303,8 @@ int
 sim_stop (sd)
      SIM_DESC sd;
 {
-  return 0;
+  State.exception = SIGINT;
+  return 1;
 }
 
 void
@@ -313,6 +325,14 @@ sim_resume (sd, step, siggnal)
     {
       unsigned long insn, extension;
 
+#ifdef NEED_UI_LOOP_HOOK
+    if (ui_loop_hook != NULL && ui_loop_hook_counter-- < 0)
+      {
+       ui_loop_hook_counter = UI_LOOP_POLL_INTERVAL;
+       ui_loop_hook (0);
+      }
+#endif /* NEED_UI_LOOP_HOOK */
+
       /* Fetch the current instruction, fetch a double word to
         avoid redundant fetching for the common cases below.  */
       inst = load_mem_big (PC, 2);
@@ -697,7 +717,7 @@ sim_info (sd, verbose)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {
index ce01a53..9a5b602 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_open, sim_create_inferior, sim_open)
+       (sim_create_inferior): Rename _bfd to bfd.
+
 2003-02-26  Andrew Cagney  <cagney@redhat.com>
 
        * am33.igen: Call sim_engine_abort instead of abort.
index d5e833e..fd93b6d 100644 (file)
@@ -312,7 +312,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   struct simops *s;
@@ -852,7 +852,7 @@ sim_info (sd, verbose)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {
@@ -946,7 +946,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   SIM_DESC sd = sim_state_alloc (kind, cb);
@@ -1114,10 +1114,10 @@ sim_open (kind, cb, abfd, argv)
     }
   else
     {
-      if ( NULL != board )
-       {
-         printf("Error: invalid --board option.\n");
-         return 0;
+      if (board != NULL)
+        {
+         sim_io_eprintf (sd, "Error: Board `%s' unknown.\n", board);
+          return 0;
        }
     }
   
@@ -1170,7 +1170,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_create_inferior (sd, prog_bfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *prog_bfd;
+     struct bfd *prog_bfd;
      char **argv;
      char **env;
 {
@@ -1329,19 +1329,39 @@ program_interrupt (SIM_DESC sd,
 {
   int status;
   struct hw *device;
+  static int in_interrupt = 0;
 
 #ifdef SIM_CPU_EXCEPTION_TRIGGER
   SIM_CPU_EXCEPTION_TRIGGER(sd,cpu,cia);
 #endif
 
-  /* copy NMI handler code from dv-mn103cpu.c */
-  /* XXX: possible infinite recursion if these store_*() calls fail! */
-  store_word (SP - 4, CIA_GET (cpu));
-  store_half (SP - 8, PSW);
+  /* avoid infinite recursion */
+  if (in_interrupt)
+    {
+      (*mn10300_callback->printf_filtered) (mn10300_callback, 
+                                           "ERROR: recursion in program_interrupt during software exception dispatch.");
+    }
+  else
+    {
+      in_interrupt = 1;
+      /* copy NMI handler code from dv-mn103cpu.c */
+      store_word (SP - 4, CIA_GET (cpu));
+      store_half (SP - 8, PSW);
+
+      /* Set the SYSEF flag in NMICR by backdoor method.  See
+        dv-mn103int.c:write_icr().  This is necessary because
+         software exceptions are not modelled by actually talking to
+         the interrupt controller, so it cannot set its own SYSEF
+         flag. */
+     if ((NULL != board) && (strcmp(board, BOARD_AM32) == 0))
+       store_byte (0x34000103, 0x04);
+    }
+
   PSW &= ~PSW_IE;
   SP = SP - 8;
   CIA_SET (cpu, 0x40000008);
 
+  in_interrupt = 0;
   sim_engine_halt(sd, cpu, NULL, cia, sim_stopped, sig);
 }
 
index 26d0431..b625ac9 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * sim_calls.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-09-27  Andrew Cagney  <ac131313@redhat.com>
 
        * hw_disk.c (hw_disk_init_address): Set device type to "block",
index f2c2d19..22aa21b 100644 (file)
@@ -85,7 +85,7 @@ static host_callback *callbacks;
 SIM_DESC
 sim_open (SIM_OPEN_KIND kind,
          host_callback *callback,
-         struct _bfd *abfd,
+         struct bfd *abfd,
          char **argv)
 {
   callbacks = callback;
@@ -244,7 +244,7 @@ sim_info (SIM_DESC sd, int verbose)
 
 SIM_RC
 sim_create_inferior (SIM_DESC sd,
-                    struct _bfd *abfd,
+                    struct bfd *abfd,
                     char **argv,
                     char **envp)
 {
index 60b41f7..007bf46 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (init_dsp, sim_open, sim_create_inferior): Rename _bfd
+       to bfd.
+
 Fri Oct 11 16:22:28 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * interp.c (trap): Return int.  Take extra parameter for address
index 8c2f359..887b7a6 100644 (file)
@@ -1424,7 +1424,7 @@ sim_size (power)
 
 static void
 init_dsp (abfd)
-     struct _bfd *abfd;
+     struct bfd *abfd;
 {
   int was_dsp = target_dsp;
   unsigned long mach = bfd_get_mach (abfd);
@@ -2140,7 +2140,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   char **p;
@@ -2239,7 +2239,7 @@ sim_load (sd, prog, abfd, from_tty)
 SIM_RC
 sim_create_inferior (sd, prog_bfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *prog_bfd;
+     struct bfd *prog_bfd;
      char **argv;
      char **env;
 {
index 5510497..9dcfd05 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * interp.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-11-30  Andrew Cagney  <cagney@redhat.com>
 
        * simops.c: Use int, 1, 0 instead of boolean, true and false.
index 85b1795..62a4616 100644 (file)
@@ -192,7 +192,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   SIM_DESC sd = sim_state_alloc (kind, cb);
@@ -297,7 +297,7 @@ sim_close (sd, quitting)
 SIM_RC
 sim_create_inferior (sd, prog_bfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *prog_bfd;
+     struct bfd *prog_bfd;
      char **argv;
      char **env;
 {
index 11e2a45..1bc783b 100644 (file)
@@ -1,3 +1,7 @@
+2003-02-27  Andrew Cagney  <cagney@redhat.com>
+
+       * iface.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * configure: Regenerated to track ../common/aclocal.m4 changes.
index c76d63f..5104172 100644 (file)
@@ -183,7 +183,7 @@ SIM_DESC
 sim_open (kind, cb, abfd, argv)
      SIM_OPEN_KIND kind;
      host_callback *cb;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
 {
   /* FIXME: The code in sim_load that determines the exact z8k arch
@@ -237,7 +237,7 @@ sim_load (sd, prog, abfd, from_tty)
 SIM_RC
 sim_create_inferior (sd, abfd, argv, env)
      SIM_DESC sd;
-     struct _bfd *abfd;
+     struct bfd *abfd;
      char **argv;
      char **env;
 {