Module Name:    src
Committed By:   yamt
Date:           Tue Jun 12 17:26:29 UTC 2012

Modified Files:
        src/sys/arch/x86/x86: intr.c

Log Message:
intr_find_mpmapping: comments and cosmetic.  no functional changes.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/x86/x86/intr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.72 src/sys/arch/x86/x86/intr.c:1.73
--- src/sys/arch/x86/x86/intr.c:1.72	Mon Aug  1 10:42:24 2011
+++ src/sys/arch/x86/x86/intr.c	Tue Jun 12 17:26:29 2012
@@ -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 @@ intr_find_pcibridge(int bus, pcitag_t *p
 #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;

Reply via email to