summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ps3
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2012-01-15 18:26:43 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2012-01-15 18:26:43 +0000
commit4371f8aebb7e829b24e1c2298abd87259f35148d (patch)
tree0a77bdf5810e51a65b5c6e0f833ebfe5b9da4aa7 /sys/powerpc/ps3
parent262107130996e0ed96134f31a40f5b371b0af705 (diff)
downloadFreeBSD-src-4371f8aebb7e829b24e1c2298abd87259f35148d.zip
FreeBSD-src-4371f8aebb7e829b24e1c2298abd87259f35148d.tar.gz
Pick a constant high IRQ value for the PS3 IPI, which lets PS3 devices be
usefully loaded and unloaded as modules. Submitted by: geoffrey dot levand at mail dot ru MFC after: 2 weeks
Diffstat (limited to 'sys/powerpc/ps3')
-rw-r--r--sys/powerpc/ps3/ps3pic.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/powerpc/ps3/ps3pic.c b/sys/powerpc/ps3/ps3pic.c
index c9b5c0e..9b40f6c 100644
--- a/sys/powerpc/ps3/ps3pic.c
+++ b/sys/powerpc/ps3/ps3pic.c
@@ -62,6 +62,7 @@ struct ps3pic_softc {
volatile uint64_t *mask_thread1;
uint64_t sc_ipi_outlet[2];
+ uint64_t sc_ipi_virq;
int sc_vector[64];
};
@@ -131,22 +132,23 @@ ps3pic_attach(device_t dev)
thread = 32 - fls(mfctrl());
lv1_configure_irq_state_bitmap(ppe, thread,
vtophys(sc->bitmap_thread0));
+
+ sc->sc_ipi_virq = 63;
+
#ifdef SMP
lv1_configure_irq_state_bitmap(ppe, !thread,
vtophys(sc->bitmap_thread1));
/* Map both IPIs to the same VIRQ to avoid changes in intr_machdep */
lv1_construct_event_receive_port(&sc->sc_ipi_outlet[0]);
- lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_outlet[0],
+ lv1_connect_irq_plug_ext(ppe, thread, sc->sc_ipi_virq,
sc->sc_ipi_outlet[0], 0);
lv1_construct_event_receive_port(&sc->sc_ipi_outlet[1]);
- lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_outlet[0],
+ lv1_connect_irq_plug_ext(ppe, !thread, sc->sc_ipi_virq,
sc->sc_ipi_outlet[1], 0);
-#else
- sc->sc_ipi_outlet[0] = sc->sc_ipi_outlet[1] = 63;
#endif
- powerpc_register_pic(dev, 0, sc->sc_ipi_outlet[0], 1, FALSE);
+ powerpc_register_pic(dev, 0, sc->sc_ipi_virq, 1, FALSE);
return (0);
}
@@ -218,7 +220,7 @@ ps3pic_mask(device_t dev, u_int irq)
sc = device_get_softc(dev);
/* Do not mask IPIs! */
- if (irq == sc->sc_ipi_outlet[0])
+ if (irq == sc->sc_ipi_virq)
return;
atomic_clear_64(&sc->mask_thread0[0], 1UL << (63 - irq));
OpenPOWER on IntegriCloud