From 98c82cc1aeac36dcc674273ae1d811df8212d579 Mon Sep 17 00:00:00 2001 From: yamt Date: Tue, 12 Jun 2012 17:26:29 +0000 Subject: [PATCH] intr_find_mpmapping: comments and cosmetic. no functional changes. --- sys/arch/x86/x86/intr.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sys/arch/x86/x86/intr.c b/sys/arch/x86/x86/intr.c index 00ddd11f7e8c..8789b24b1d33 100644 --- a/sys/arch/x86/x86/intr.c +++ b/sys/arch/x86/x86/intr.c @@ -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 -__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 *pci_bridge_tag, #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;