Regenerate configure in sim
[deliverable/binutils-gdb.git] / sim / ppc / emul_chirp.c
index c9bb89c5e0c71586b801555f13586c788abd582d..f326410b060ddb16922261eaf967402d88504cbd 100644 (file)
@@ -1,10 +1,10 @@
 /*  This file is part of the program psim.
 
-    Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
+    Copyright 1994, 1995, 1996, 1997, 2003 Andrew Cagney
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+    along with this program; if not, see <http://www.gnu.org/licenses/>.
 
     */
 
@@ -584,10 +583,15 @@ chirp_emul_nextprop(os_emul_data *data,
   if (chirp_read_t2h_args(&args, sizeof(args), 3, 1, data, processor, cia))
     return -1;
   phandle = external_to_device(data->root, args.phandle);
-  emul_read_string(previous,
-                  args.previous,
-                  sizeof(previous),
-                  processor, cia);
+  if (args.previous != 0)
+    emul_read_string(previous,
+                    args.previous,
+                    sizeof(previous),
+                    processor, cia);
+  else
+    /* If previous is NULL, make it look like the empty string.  The
+       next property after the empty string is the first property.  */
+    strcpy (previous, "");
   TRACE(trace_os_emul, ("nextprop - in - phandle=0x%lx(0x%lx`%s') previous=`%s' buf=0x%lx\n",
                        (unsigned long)args.phandle,
                        (unsigned long)phandle,
@@ -602,11 +606,19 @@ chirp_emul_nextprop(os_emul_data *data,
   else {
     const device_property *prev_prop = device_find_property(phandle, previous);
     if (prev_prop == NULL) {
-      args.flag = -1; /* name invalid */
+      if (strcmp (previous, "") == 0)
+       args.flag = 0; /* No properties */
+      else
+       args.flag = -1; /* name invalid */
     }
     else {
       const device_property *next_prop;
-      next_prop = device_next_property(prev_prop);
+      if (strcmp (previous, "") == 0) {
+       next_prop = prev_prop;  /* The first property.  */
+      }
+      else {
+       next_prop = device_next_property(prev_prop);
+      }
       if (next_prop == NULL) {
        args.flag = 0; /* last property */
       }
@@ -1537,7 +1549,7 @@ map_over_chirp_note(bfd *image,
     if (head.descsz == sizeof(note->desc))
       note->desc.load_base = bfd_get_32(image, (void*)&note->desc.load_base);
     else
-      note->desc.load_base = CHIRP_LOAD_BASE;
+      note->desc.load_base = (signed32)-1;
   }
 }
 
@@ -1904,6 +1916,18 @@ emul_chirp_create(device *root,
     tree_parse(node, "./pp %d", 0x2);
   }
 
+  /* map in the interrupt vectors */
+
+  if (!chirp->real_mode) {
+    node = tree_parse(root, "/openprom/init/htab/pte@0x0");
+    tree_parse(node, "./psim,description \"map in interrupt vectors");
+    tree_parse(node, "./virtual-address 0x0");
+    tree_parse(node, "./real-address 0x0");
+    tree_parse(node, "./nr-bytes 0x3000");
+    tree_parse(node, "./wimg %d", 0x7);
+    tree_parse(node, "./pp %d", 0x2);
+  }
+
   return chirp;
 }
 
This page took 0.025482 seconds and 4 git commands to generate.