diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-07-19 19:25:19 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-07-19 19:25:19 +0000 |
commit | 654a732570cb496c6435602c7436a0e4156b3937 (patch) | |
tree | c6a9a6cde7df26a09681d10d43007fee098a3573 /sys/arch | |
parent | 78874dd9bcf2cf9c69fb1f2e4475cb62f6bf64b9 (diff) |
In dec_1000a_intr_map(), use the SRM hint if available. This allows cards
plugged to the bottom 4 PCI slots of AlphaServer 1000A (attaching to pci1
behind a ppb) to get interrupts.
No regressions on AlphaServer 800 (which do not have these extra slots).
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/pci/pci_1000a.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/arch/alpha/pci/pci_1000a.c b/sys/arch/alpha/pci/pci_1000a.c index 75b86ded6b6..2841a7553a9 100644 --- a/sys/arch/alpha/pci/pci_1000a.c +++ b/sys/arch/alpha/pci/pci_1000a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_1000a.c,v 1.7 2008/06/26 05:42:09 ray Exp $ */ +/* $OpenBSD: pci_1000a.c,v 1.8 2008/07/19 19:25:18 miod Exp $ */ /* $NetBSD: pci_1000a.c,v 1.14 2001/07/27 00:25:20 thorpej Exp $ */ /* @@ -152,7 +152,7 @@ dec_1000a_intr_map(ccv, bustag, buspin, line, ihp) int buspin, line; pci_intr_handle_t *ihp; { - int imrbit, device; + int imrbit = 0, device; /* * Get bit number in mystery ICU imr */ @@ -180,15 +180,24 @@ dec_1000a_intr_map(ccv, bustag, buspin, line, ihp) return 1; if (!(1 <= buspin && buspin <= 4)) goto bad; + pci_decompose_tag(pc_tag, bustag, NULL, &device, NULL); - if (0 <= device && device < sizeof imrmap / sizeof imrmap[0]) { + + /* + * The console places the interrupt mapping in the "line" value. + * We trust it whenever possible. + */ + if (line >= 0 && line < PCI_NIRQ) { + imrbit = line + 1; + } else if (0 <= device && device < sizeof imrmap / sizeof imrmap[0]) { if (device == 0) printf("dec_1000a_intr_map: ?! UNEXPECTED DEV 0\n"); imrbit = imrmap[device][buspin - 1]; - if (imrbit) { - *ihp = IMR2IRQ(imrbit); - return 0; - } + } + + if (imrbit) { + *ihp = IMR2IRQ(imrbit); + return 0; } bad: return 1; |