diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-06-23 22:33:03 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-06-23 22:33:03 +0000 |
commit | d7c1d40d534867476888e6e606958e8fbd40c9ed (patch) | |
tree | ff8b1d63cb631f68a84a7e7f36db92e471009d87 /sys/powerpc/aim | |
parent | 9f1a0b6386f1d24c42f4060d8550ee46b014b2ec (diff) | |
download | FreeBSD-src-d7c1d40d534867476888e6e606958e8fbd40c9ed.zip FreeBSD-src-d7c1d40d534867476888e6e606958e8fbd40c9ed.tar.gz |
Configure interrupts on SMP systems to be distributed among all online
CPUs by default, and provide a functional version of BUS_BIND_INTR().
While here, fix some potential concurrency problems in the interrupt
handling code.
Diffstat (limited to 'sys/powerpc/aim')
-rw-r--r-- | sys/powerpc/aim/nexus.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/powerpc/aim/nexus.c b/sys/powerpc/aim/nexus.c index a9cf125..53a9dd1 100644 --- a/sys/powerpc/aim/nexus.c +++ b/sys/powerpc/aim/nexus.c @@ -119,6 +119,12 @@ static device_t nexus_add_child(device_t, int, const char *, int); static void nexus_probe_nomatch(device_t, device_t); static int nexus_read_ivar(device_t, device_t, int, uintptr_t *); static int nexus_write_ivar(device_t, device_t, int, uintptr_t); +#ifdef SMP +static int nexus_bind_intr(device_t dev, device_t child, + struct resource *irq, int cpu); +#endif +static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol); static int nexus_setup_intr(device_t, device_t, struct resource *, int, driver_filter_t *, driver_intr_t *, void *, void **); static int nexus_teardown_intr(device_t, device_t, struct resource *, @@ -162,6 +168,10 @@ static device_method_t nexus_methods[] = { DEVMETHOD(bus_write_ivar, nexus_write_ivar), DEVMETHOD(bus_setup_intr, nexus_setup_intr), DEVMETHOD(bus_teardown_intr, nexus_teardown_intr), +#ifdef SMP + DEVMETHOD(bus_bind_intr, nexus_bind_intr), +#endif + DEVMETHOD(bus_config_intr, nexus_config_intr), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -363,6 +373,23 @@ nexus_teardown_intr(device_t dev, device_t child, struct resource *res, return (powerpc_teardown_intr(cookie)); } +#ifdef SMP +static int +nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) +{ + + return (powerpc_bind_intr(rman_get_start(irq), cpu)); +} +#endif + +static int +nexus_config_intr(device_t dev, int irq, enum intr_trigger trig, + enum intr_polarity pol) +{ + + return (powerpc_config_intr(irq, trig, pol)); +} + /* * Allocate resources at the behest of a child. This only handles interrupts, * since I/O resources are handled by child busses. |