pci intr config: Fix an off by one bug
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Wed, 4 Feb 2009 10:39:27 +0000 (18:39 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 6 Feb 2009 10:42:53 +0000 (18:42 +0800)
commit16c751ca33dd2f66ee5626e66dcf07f6cd02cfce
treee55f448913042ca3db7e336e3ce99eb3fb0a6294
parent2ff5b40552625e6e22ecc67d5df0acc8f54638e7
pci intr config: Fix an off by one bug

FreeBSD pci_pir.c rev1.105
  We represent PCI intpin's two different ways.  One is the way that the
  intpin register is expressed in hardware where 0 means none, 1 means INTA,
  2 INTB, etc.  The other way is commonly used in loops where 0 means INTA,
  1 means INTB, etc.  The matchpin argument to pci_cfgintr_search() is
  supposed to be the first form, but we passsed in a loop index of the
  second.  This fix adds one to the loop index to convert to the first form.

  Reported by: Pavlin Radoslavov <pavlin@icir.org>
sys/bus/pci/amd64/pci_cfgreg.c
sys/bus/pci/i386/pci_cfgreg.c