diff options
author | jhb <jhb@FreeBSD.org> | 2000-10-05 23:09:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-10-05 23:09:57 +0000 |
commit | 71938e9fcdc7dcdcee180aaf1693bdfbc2f62749 (patch) | |
tree | f79e43496c9e52b9fb7344402240cb467ffe42b4 /sys/alpha/pci | |
parent | d3d06a3e7cf8a76f1ff2e19d172e10e60b30aed5 (diff) | |
download | FreeBSD-src-71938e9fcdc7dcdcee180aaf1693bdfbc2f62749.zip FreeBSD-src-71938e9fcdc7dcdcee180aaf1693bdfbc2f62749.tar.gz |
- Heavyweight interrupt threads on the alpha for device I/O interrupts.
- Make softinterrupts (SWI's) almost completely MI, and divorce them
completely from the x86 hardware interrupt code.
- The ihandlers array is now gone. Instead, there is a MI shandlers array
that just contains SWI handlers.
- Most of the former machine/ipl.h files have moved to a new sys/ipl.h.
- Stub out all the spl*() functions on all architectures.
Submitted by: dfr
Diffstat (limited to 'sys/alpha/pci')
-rw-r--r-- | sys/alpha/pci/apecs.c | 24 | ||||
-rw-r--r-- | sys/alpha/pci/cia.c | 30 | ||||
-rw-r--r-- | sys/alpha/pci/pcibus.c | 11 | ||||
-rw-r--r-- | sys/alpha/pci/t2.c | 39 | ||||
-rw-r--r-- | sys/alpha/pci/tsunami.c | 24 |
5 files changed, 110 insertions, 18 deletions
diff --git a/sys/alpha/pci/apecs.c b/sys/alpha/pci/apecs.c index e15aee1..ddd129a 100644 --- a/sys/alpha/pci/apecs.c +++ b/sys/alpha/pci/apecs.c @@ -62,7 +62,9 @@ #include <sys/malloc.h> #include <sys/bus.h> #include <machine/bus.h> +#include <sys/proc.h> #include <sys/rman.h> +#include <sys/interrupt.h> #include <alpha/pci/apecsreg.h> #include <alpha/pci/apecsvar.h> @@ -334,6 +336,20 @@ apecs_release_resource(device_t bus, device_t child, int type, int rid, return pci_release_resource(bus, child, type, rid, r); } +static void +apecs_disable_intr(int vector) +{ + int irq = (vector - 0x900) >> 4; + platform.pci_intr_disable(irq); +} + +static void +apecs_enable_intr(int vector) +{ + int irq = (vector - 0x900) >> 4; + platform.pci_intr_enable(irq); +} + static int apecs_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, @@ -353,9 +369,11 @@ apecs_setup_intr(device_t dev, device_t child, if (error) return error; - error = alpha_setup_intr(0x900 + (irq->r_start << 4), - intr, arg, cookiep, - &intrcnt[INTRCNT_EB64PLUS_IRQ + irq->r_start]); + error = alpha_setup_intr(device_get_nameunit(child ? child : dev), + 0x900 + (irq->r_start << 4), intr, arg, + ithread_priority(flags), cookiep, + &intrcnt[INTRCNT_EB64PLUS_IRQ + irq->r_start], + apecs_disable_intr, apecs_enable_intr); if (error) return error; diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c index 7357753..14dfa98 100644 --- a/sys/alpha/pci/cia.c +++ b/sys/alpha/pci/cia.c @@ -98,7 +98,9 @@ #include <sys/malloc.h> #include <sys/bus.h> #include <machine/bus.h> +#include <sys/proc.h> #include <sys/rman.h> +#include <sys/interrupt.h> #include <alpha/pci/ciareg.h> #include <alpha/pci/ciavar.h> @@ -380,6 +382,7 @@ static int cia_probe(device_t dev) { uintptr_t use_bwx = 1; + device_t child; if (cia0) return ENXIO; @@ -428,9 +431,9 @@ cia_probe(device_t dev) } } - device_add_child(dev, "pcib", 0); - device_set_ivars(dev, (void *)use_bwx); + child = device_add_child(dev, "pcib", 0); chipset_bwx = use_bwx = (use_bwx == (uintptr_t) 1); + device_set_ivars(child, (void *)use_bwx); return 0; } @@ -511,6 +514,20 @@ cia_attach(device_t dev) return 0; } +static void +cia_disable_intr(int vector) +{ + int irq = (vector - 0x900) >> 4; + platform.pci_intr_disable(irq); +} + +static void +cia_enable_intr(int vector) +{ + int irq = (vector - 0x900) >> 4; + platform.pci_intr_enable(irq); +} + static int cia_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, @@ -522,9 +539,12 @@ cia_setup_intr(device_t dev, device_t child, if (error) return error; - error = alpha_setup_intr(0x900 + (irq->r_start << 4), - intr, arg, cookiep, - &intrcnt[INTRCNT_EB164_IRQ + irq->r_start]); + error = alpha_setup_intr( + device_get_nameunit(child ? child : dev), + 0x900 + (irq->r_start << 4), intr, arg, + ithread_priority(flags), cookiep, + &intrcnt[INTRCNT_EB164_IRQ + irq->r_start], + cia_disable_intr, cia_enable_intr); if (error) return error; diff --git a/sys/alpha/pci/pcibus.c b/sys/alpha/pci/pcibus.c index 8aaf9fb..0d54f63 100644 --- a/sys/alpha/pci/pcibus.c +++ b/sys/alpha/pci/pcibus.c @@ -31,6 +31,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/module.h> +#include <sys/proc.h> #include <sys/bus.h> #include <machine/bus.h> #include <sys/interrupt.h> @@ -97,17 +98,19 @@ alpha_platform_release_ide_intr(int chan, struct resource *res) } int -alpha_platform_setup_ide_intr(struct resource *res, +alpha_platform_setup_ide_intr(device_t dev, + struct resource *res, driver_intr_t *fn, void *arg, void **cookiep) { - return isa_setup_intr(0, 0, res, INTR_TYPE_BIO, fn, arg, cookiep); + return isa_setup_intr(0, dev, res, INTR_TYPE_BIO, fn, arg, cookiep); } int -alpha_platform_teardown_ide_intr(struct resource *res, void *cookie) +alpha_platform_teardown_ide_intr(device_t dev, + struct resource *res, void *cookie) { - return isa_teardown_intr(0, 0, res, cookie); + return isa_teardown_intr(0, dev, res, cookie); } #else struct resource * diff --git a/sys/alpha/pci/t2.c b/sys/alpha/pci/t2.c index db7deae..a15ff16 100644 --- a/sys/alpha/pci/t2.c +++ b/sys/alpha/pci/t2.c @@ -37,7 +37,9 @@ #include <sys/malloc.h> #include <sys/bus.h> #include <machine/bus.h> +#include <sys/proc.h> #include <sys/rman.h> +#include <sys/interrupt.h> #include <alpha/pci/t2reg.h> #include <alpha/pci/t2var.h> @@ -326,6 +328,36 @@ static const char irq_to_mask[40] = { 0, 1, 2, 3, 4, 5, 6, 7 /* PCI 0-7 XXX */ }; +static void +t2_disable_intr(int vector) +{ + int mask = (vector - 0x900) >> 4; + + t2_shadow_mask |= (1UL << mask); + + if (mask <= 7) + outb(SLAVE0_ICU, t2_shadow_mask); + else if (mask <= 15) + outb(SLAVE1_ICU, t2_shadow_mask >> 8); + else + outb(SLAVE2_ICU, t2_shadow_mask >> 16); +} + +static void +t2_enable_intr(int vector) +{ + int mask = (vector - 0x900) >> 4; + + t2_shadow_mask &= ~(1UL << mask); + + if (mask <= 7) + outb(SLAVE0_ICU, t2_shadow_mask); + else if (mask <= 15) + outb(SLAVE1_ICU, t2_shadow_mask >> 8); + else + outb(SLAVE2_ICU, t2_shadow_mask >> 16); +} + static int t2_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, @@ -340,9 +372,10 @@ t2_setup_intr(device_t dev, device_t child, if (error) return error; - error = alpha_setup_intr(vector, - intr, arg, cookiep, - &intrcnt[irq->r_start]); + error = alpha_setup_intr(device_get_nameunit(child ? child : dev), + vector, intr, arg, ithread_priority(flags), cookiep, + &intrcnt[irq->r_start], + t2_disable_intr, t2_enable_intr); if (error) return error; diff --git a/sys/alpha/pci/tsunami.c b/sys/alpha/pci/tsunami.c index 4f43e5c..f2ef20f 100644 --- a/sys/alpha/pci/tsunami.c +++ b/sys/alpha/pci/tsunami.c @@ -34,7 +34,9 @@ #include <sys/module.h> #include <sys/bus.h> #include <machine/bus.h> +#include <sys/proc.h> #include <sys/rman.h> +#include <sys/interrupt.h> #include <sys/malloc.h> #include <pci/pcivar.h> @@ -302,6 +304,20 @@ tsunami_attach(device_t dev) return 0; } +static void +tsunami_disable_intr_vec(int vector) +{ + int irq = (vector - 0x900) >> 4; + platform.pci_intr_disable(irq); +} + +static void +tsunami_enable_intr_vec(int vector) +{ + int irq = (vector - 0x900) >> 4; + platform.pci_intr_enable(irq); +} + static int tsunami_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, @@ -313,9 +329,11 @@ tsunami_setup_intr(device_t dev, device_t child, if (error) return error; - error = alpha_setup_intr(0x900 + (irq->r_start << 4), - intr, arg, cookiep, - &intrcnt[INTRCNT_EB164_IRQ + irq->r_start]); + error = alpha_setup_intr(device_get_nameunit(child ? child : dev), + 0x900 + (irq->r_start << 4), intr, arg, + ithread_priority(flags), cookiep, + &intrcnt[INTRCNT_EB164_IRQ + irq->r_start], + tsunami_disable_intr_vec, tsunami_enable_intr_vec); if (error) return error; |