intr_find_mpmapping: comments and cosmetic. no functional changes.

This commit is contained in:
yamt 2012-06-12 17:26:29 +00:00
parent 721722497b
commit 98c82cc1ae
1 changed files with 13 additions and 11 deletions

View File

@ -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 *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;