Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/sparc64 Restrict the check for fully specif...



details:   https://anonhg.NetBSD.org/src/rev/baf7e3035f27
branches:  trunk
changeset: 342585:baf7e3035f27
user:      jdc <jdc%NetBSD.org@localhost>
date:      Wed Dec 30 09:16:17 2015 +0000

description:
Restrict the check for fully specified interrupts to machines with psycho
controllers only, and adjust comments to note this.

See also the mail thread starting at:
  http://mail-index.NetBSD.org/port-sparc64/2015/12/03/msg002488.html

diffstat:

 sys/arch/sparc64/sparc64/ofw_machdep.c |  32 +++++++++++++++-----------------
 1 files changed, 15 insertions(+), 17 deletions(-)

diffs (63 lines):

diff -r b05fdf2fec72 -r baf7e3035f27 sys/arch/sparc64/sparc64/ofw_machdep.c
--- a/sys/arch/sparc64/sparc64/ofw_machdep.c    Wed Dec 30 04:30:27 2015 +0000
+++ b/sys/arch/sparc64/sparc64/ofw_machdep.c    Wed Dec 30 09:16:17 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_machdep.c,v 1.44 2015/03/02 14:17:06 nakayama Exp $        */
+/*     $NetBSD: ofw_machdep.c,v 1.45 2015/12/30 09:16:17 jdc Exp $     */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.44 2015/03/02 14:17:06 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.45 2015/12/30 09:16:17 jdc Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -738,22 +738,22 @@
        int phc_node;
        int rc = -1;
 
+       phc_node = find_pci_host_node(node);
+
        /* 
-        * Don't try to map interrupts for onboard devices, or if the
-        * interrupt is already fully specified.
-        * XXX This should be done differently (i.e. by matching
-        * the node name) - but we need access to a machine where
-        * a change is testable - hence the printf below.
+        * On machines with psycho PCI controllers, we don't need to map
+        * interrupts if they are already fully specified (0x20 to 0x3f
+        * for onboard devices and IGN 0x7c0 for psycho0/psycho1).
         */
        if (*interrupt & 0x20 || *interrupt & 0x7c0) {
-               char name[40];
-
-               OF_getprop(node, "name", &name, sizeof(name));
-               printf("\nATTENTION: if you see this message, please mail "
-                   "the output of \"dmesg\" and \"ofctl -p\" to "
-                   "port-sparc64%NetBSD.org@localhost!\n"
-                   "Not mapping interrupt for node %s (%x)\n", name, node);
-               return validlen;
+               char model[40];
+               
+               if (OF_getprop(phc_node, "model", &model, sizeof(model)) > 10
+                   && !strcmp(model, "SUNW,psycho")) {
+                       DPRINTF(("OF_mapintr: interrupt %x already mapped\n",
+                           *interrupt));
+                       return validlen;
+               }
        }
 
        /*
@@ -775,8 +775,6 @@
                return (-1);
        }
 
-       phc_node = find_pci_host_node(node);
-
        while (node) {
 #ifdef DEBUG
                char name[40];



Home | Main Index | Thread Index | Old Index