* hw-tree.c (hw_tree_find_property): Return NULL when device is not found.
authorAndrew Cagney <cagney@redhat.com>
Wed, 25 Mar 1998 22:37:33 +0000 (22:37 +0000)
committerAndrew Cagney <cagney@redhat.com>
Wed, 25 Mar 1998 22:37:33 +0000 (22:37 +0000)
(hw_tree_find_*_property): Clean up error message when property is not found.
* dv-pal.c (hw_pal_io_read_buffer): Check the smp property is present before
looking for it.

sim/common/ChangeLog
sim/common/dv-pal.c

index 9d0537fa33fcf21972da689ab4471da71474a4ba..833f51de534aa11ff12c63d2d0595b3d7d27dc96 100644 (file)
@@ -1,3 +1,13 @@
+Thu Mar 26 09:10:56 1998  Andrew Cagney  <cagney@b1.cygnus.com>
+
+       * hw-tree.c (hw_tree_find_property): Return NULL when device is
+       not found.
+       (hw_tree_find_*_property): Clean up error message when property is
+       not found.
+
+       * dv-pal.c (hw_pal_io_read_buffer): Check the smp property is
+       present before looking for it.
+
 Wed Mar 25 16:17:38 1998  Ian Carmichael  <iancarm@cygnus.com>
 
        * aclocal.m4 (AC_CHECK_HEADERS): Add check for fpu_control.h.  
index 95554aab842ce1744dfd2673b2659726d6d1f81a..4f19ff3edb45728c4db54db4880beecc5b4e8c4f 100644 (file)
@@ -357,8 +357,16 @@ hw_pal_io_read_buffer (struct hw *me,
       break;
 
     case hw_pal_nr_cpu_register:
-      *byte = hw_tree_find_integer_property (me, "/openprom/options/smp");
-      HW_TRACE ((me, "read - nr-cpu %d\n", *byte));
+      if (hw_tree_find_property (me, "/openprom/options/smp") == NULL)
+       {
+         *byte = 1;
+         HW_TRACE ((me, "read - nr-cpu %d (not defined)\n", *byte));
+       }
+      else
+       {
+         *byte = hw_tree_find_integer_property (me, "/openprom/options/smp");
+         HW_TRACE ((me, "read - nr-cpu %d\n", *byte));
+       }
       break;
 
     case hw_pal_read_fifo: