Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/pci Deal with OFW trees that have interrupt ...



details:   https://anonhg.NetBSD.org/src/rev/931a98e3dc93
branches:  trunk
changeset: 565446:931a98e3dc93
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Apr 08 23:58:24 2004 +0000

description:
Deal with OFW trees that have interrupt nodes without an #address-cells
property.  Treat them as if they had such a property but its value was 0.

diffstat:

 sys/arch/macppc/pci/pci_machdep.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 44b3af166ad6 -r 931a98e3dc93 sys/arch/macppc/pci/pci_machdep.c
--- a/sys/arch/macppc/pci/pci_machdep.c Thu Apr 08 21:02:57 2004 +0000
+++ b/sys/arch/macppc/pci/pci_machdep.c Thu Apr 08 23:58:24 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.24 2004/02/24 15:16:04 wiz Exp $     */
+/*     $NetBSD: pci_machdep.c,v 1.25 2004/04/08 23:58:24 matt Exp $    */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.24 2004/02/24 15:16:04 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.25 2004/04/08 23:58:24 matt Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -423,7 +423,10 @@
                 */
                iparent = *mp++;
                len -= 4;
-               if (OF_getprop(iparent, "#address-cells", &acells, 4) != 4)
+               i = OF_getprop(iparent, "#address-cells", &acells, 4);
+               if (i <= 0)
+                       acells = 0;
+               else if (i != 4)
                        return -1;
                if (OF_getprop(iparent, "#interrupt-cells", &icells, 4) != 4)
                        return -1;



Home | Main Index | Thread Index | Old Index