summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/pci/psycho.c
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2002-12-01 23:30:26 +0000
committertmm <tmm@FreeBSD.org>2002-12-01 23:30:26 +0000
commit0363c4c523474806f1a192bd5c9081cde0850288 (patch)
tree4b045fb555d2b9d04e23e9ea37969ee08fb63420 /sys/sparc64/pci/psycho.c
parent7ed7cdac580b034966a8b7e8ba9e0d8b51cab854 (diff)
downloadFreeBSD-src-0363c4c523474806f1a192bd5c9081cde0850288.zip
FreeBSD-src-0363c4c523474806f1a192bd5c9081cde0850288.tar.gz
Always initialize the UPA target module id in the interrupt mapping
register to the one of the processor doing the interrupt setup. This is required since this field is preinitialized to 0, but there exist machines which have no processor with a MID of 0 (e.g. e450s with 1 or 2 processors). Add some more macros for handle the interrupt mapping registers, and rename some existing ones for consistency. Approved by: re
Diffstat (limited to 'sys/sparc64/pci/psycho.c')
-rw-r--r--sys/sparc64/pci/psycho.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/sparc64/pci/psycho.c b/sys/sparc64/pci/psycho.c
index 33b3faf..79e2f09 100644
--- a/sys/sparc64/pci/psycho.c
+++ b/sys/sparc64/pci/psycho.c
@@ -43,6 +43,7 @@
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
+#include <sys/pcpu.h>
#include <ofw/openfirm.h>
#include <ofw/ofw_pci.h>
@@ -576,7 +577,7 @@ psycho_attach(device_t dev)
PSYCHO_WRITE8(sc, map, mr & ~INTMAP_V);
for (i = 0; i < 4; i++)
PCICTL_WRITE8(sc, clr + i * 8, 0);
- PSYCHO_WRITE8(sc, map, mr | INTMAP_V);
+ PSYCHO_WRITE8(sc, map, INTMAP_ENABLE(mr, PCPU_GET(mid)));
}
for (map = PSR_SCSI_INT_MAP, clr = PSR_SCSI_INT_CLR, n = 0;
map < PSR_FFB0_INT_MAP; map += 8, clr += 8, n++) {
@@ -602,7 +603,7 @@ psycho_attach(device_t dev)
psycho_intr_stray, sclr);
}
#endif
- PSYCHO_WRITE8(sc, map, mr | INTMAP_V);
+ PSYCHO_WRITE8(sc, map, INTMAP_ENABLE(mr, PCPU_GET(mid)));
}
#endif
@@ -657,7 +658,7 @@ psycho_set_intr(struct psycho_softc *sc, int index,
panic("psycho_set_intr: failed to get interrupt");
bus_setup_intr(dev, sc->sc_irq_res[index], INTR_TYPE_MISC | iflags,
handler, sc, &sc->sc_ihand[index]);
- PSYCHO_WRITE8(sc, map, mr | INTMAP_V);
+ PSYCHO_WRITE8(sc, map, INTMAP_ENABLE(mr, PCPU_GET(mid)));
}
static int
@@ -1126,11 +1127,10 @@ psycho_setup_intr(device_t dev, device_t child,
*/
PSYCHO_WRITE8(sc, intrclrptr, 0);
/*
- * Enable the interrupt now we have the handler installed.
- * Read the current value as we can't change it besides the
- * valid bit so so make sure only this bit is changed.
+ * Enable the interrupt and program the target module now we have the
+ * handler installed.
*/
- PSYCHO_WRITE8(sc, intrmapptr, mr | INTMAP_V);
+ PSYCHO_WRITE8(sc, intrmapptr, INTMAP_ENABLE(mr, PCPU_GET(mid)));
return (error);
}
OpenPOWER on IntegriCloud