summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/pps.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-09-15 22:26:32 +0000
committerjhb <jhb@FreeBSD.org>2008-09-15 22:26:32 +0000
commitc0edaf988ab997509a5c7a738c5fb5c5305cc014 (patch)
treec5d594dd29d8cb1dbd07768c75b6649ad621cee2 /sys/dev/ppbus/pps.c
parenta55e334c2b95f0796667f2ecdd2434e08fe6f8fc (diff)
downloadFreeBSD-src-c0edaf988ab997509a5c7a738c5fb5c5305cc014.zip
FreeBSD-src-c0edaf988ab997509a5c7a738c5fb5c5305cc014.tar.gz
Rework the handling of interrupt handlers for children of ppc and ppbus:
- Retire IVARs for passing IRQs around. Instead, ppbus and ppc now allow child devices to access the interrupt by via a rid 0 IRQ resource using bus_alloc_resource_any(). - ppc creates its own interrupt event to manage the interrupt handlers of child devices. ppc does not allow child devices to use filters. It could allow this if needed, but none of the current drivers use them and it adds a good bit of complication. It uses intr_event_execute_handlers() to fire the child device interrupt handlers from its threaded interrupt handler. - Remove the ppbus_dummy_intr() hack. Now the ppc device always has an interrupt handler registered and we no longer bounce all the way up to nexus to manage adding/removing ppbus child interrupt handlers. Instead, the child handlers are added and removed to the private interrupt event in the ppc device.
Diffstat (limited to 'sys/dev/ppbus/pps.c')
-rw-r--r--sys/dev/ppbus/pps.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c
index e491ed2..6ab904c 100644
--- a/sys/dev/ppbus/pps.c
+++ b/sys/dev/ppbus/pps.c
@@ -107,18 +107,14 @@ ppsattach(device_t dev)
struct pps_data *sc = DEVTOSOFTC(dev);
device_t ppbus = device_get_parent(dev);
struct cdev *d;
- intptr_t irq;
- int i, unit, zero = 0;
+ int i, unit, rid = 0;
mtx_init(&sc->mtx, device_get_nameunit(dev), "pps", MTX_SPIN);
- /* retrieve the ppbus irq */
- BUS_READ_IVAR(ppbus, dev, PPBUS_IVAR_IRQ, &irq);
- if (irq > 0) {
- /* declare our interrupt handler */
- sc->intr_resource = bus_alloc_resource(dev, SYS_RES_IRQ,
- &zero, irq, irq, 1, RF_SHAREABLE);
- }
+ /* declare our interrupt handler */
+ sc->intr_resource = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+ RF_SHAREABLE);
+
/* interrupts seem mandatory */
if (sc->intr_resource == NULL)
return (ENXIO);
OpenPOWER on IntegriCloud