Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 intr_find_mpmapping: comments and cosmetic....



details:   https://anonhg.NetBSD.org/src/rev/d37f5288c15d
branches:  trunk
changeset: 779702:d37f5288c15d
user:      yamt <yamt%NetBSD.org@localhost>
date:      Tue Jun 12 17:26:29 2012 +0000

description:
intr_find_mpmapping: comments and cosmetic.  no functional changes.

diffstat:

 sys/arch/x86/x86/intr.c |  24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diffs (55 lines):

diff -r 92f4eb30085b -r d37f5288c15d sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Tue Jun 12 17:14:19 2012 +0000
+++ b/sys/arch/x86/x86/intr.c   Tue Jun 12 17:26:29 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $       */
+/*     $NetBSD: intr.c,v 1.73 2012/06/12 17:26:29 yamt Exp $   */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.73 2012/06/12 17:26:29 yamt Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -359,25 +359,27 @@
 #endif
 
 #if NIOAPIC > 0 || NACPICA > 0
+/*
+ * 'pin' argument is (dev << 2) | pin0
+ * where dev is PCI device number (0-255) and
+ * pin0 is PCI interrupt pin number (0-3)
+ */
 int
 intr_find_mpmapping(int bus, int pin, int *handle)
 {
-#if NPCI > 0
-       int dev, func;
-       pcitag_t pci_bridge_tag;
-       pci_chipset_tag_t pc;
-#endif
 
 #if NPCI > 0
        while (intr_scan_bus(bus, pin, handle) != 0) {
-               if (intr_find_pcibridge(bus, &pci_bridge_tag,
-                   &pc) != 0)
+               int dev, func;
+               pcitag_t pci_bridge_tag;
+               pci_chipset_tag_t pc;
+
+               if (intr_find_pcibridge(bus, &pci_bridge_tag, &pc) != 0)
                        return ENOENT;
                dev = pin >> 2;
                pin = pin & 3;
                pin = PPB_INTERRUPT_SWIZZLE(pin + 1, dev) - 1;
-               pci_decompose_tag(pc, pci_bridge_tag, &bus,
-                   &dev, &func);
+               pci_decompose_tag(pc, pci_bridge_tag, &bus, &dev, &func);
                pin |= (dev << 2);
        }
        return 0;



Home | Main Index | Thread Index | Old Index