diff options
author | bde <bde@FreeBSD.org> | 1996-03-29 15:01:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1996-03-29 15:01:51 +0000 |
commit | e88d323eb20988f53ffb90de744aaaae4bae697f (patch) | |
tree | 2ab599000382dcbb5ea1679aec7308f2267ebd2c /sys/i386/pci | |
parent | f92ab043066bf68921deefc5e9e6d7ee03fe6b8f (diff) | |
download | FreeBSD-src-e88d323eb20988f53ffb90de744aaaae4bae697f.zip FreeBSD-src-e88d323eb20988f53ffb90de744aaaae4bae697f.tar.gz |
Count PCI irqs in up to 4 ISAish counters named `pci irqnn' instead of
in the clk0 counter.
Reviewed by: s
Diffstat (limited to 'sys/i386/pci')
-rw-r--r-- | sys/i386/pci/pci_bus.c | 33 | ||||
-rw-r--r-- | sys/i386/pci/pci_cfgreg.c | 33 | ||||
-rw-r--r-- | sys/i386/pci/pci_pir.c | 33 |
3 files changed, 90 insertions, 9 deletions
diff --git a/sys/i386/pci/pci_bus.c b/sys/i386/pci/pci_bus.c index bfa8899..b4c3b8a 100644 --- a/sys/i386/pci/pci_bus.c +++ b/sys/i386/pci/pci_bus.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcibus.c,v 1.20 1995/12/10 13:39:04 phk Exp $ +** $Id: pcibus.c,v 1.21 1995/12/16 00:27:59 bde Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -35,6 +35,8 @@ *************************************************************************** */ +#include "vector.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -425,10 +427,35 @@ pcibus_write (pcici_t tag, u_long reg, u_long data) static int pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned * maskptr) { - int result; + char buf[16]; + char *cp; + int free_id, id, result; + + sprintf(buf, "pci irq%d", irq); + for (cp = intrnames, free_id = 0, id = 0; id < NR_DEVICES; id++) { + if (strcmp(cp, buf) == 0) + break; + if (free_id <= 0 && strcmp(cp, "pci irqnn") == 0) + free_id = id; + while (*cp++ != '\0') + ; + } + if (id == NR_DEVICES) { + id = free_id; + if (id == 0) { + /* + * All pci irq counters are in use, perhaps because + * config is old so there aren't any. Abuse the + * clk0 counter. + */ + printf ( + "pcibus_ihandler_attach: counting pci irq%d's as clk0 irqs\n", + irq); + } + } result = register_intr( irq, /* isa irq */ - 0, /* deviced?? */ + id, /* device id */ 0, /* flags? */ func, /* handler */ maskptr, /* mask pointer */ diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index bfa8899..b4c3b8a 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcibus.c,v 1.20 1995/12/10 13:39:04 phk Exp $ +** $Id: pcibus.c,v 1.21 1995/12/16 00:27:59 bde Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -35,6 +35,8 @@ *************************************************************************** */ +#include "vector.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -425,10 +427,35 @@ pcibus_write (pcici_t tag, u_long reg, u_long data) static int pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned * maskptr) { - int result; + char buf[16]; + char *cp; + int free_id, id, result; + + sprintf(buf, "pci irq%d", irq); + for (cp = intrnames, free_id = 0, id = 0; id < NR_DEVICES; id++) { + if (strcmp(cp, buf) == 0) + break; + if (free_id <= 0 && strcmp(cp, "pci irqnn") == 0) + free_id = id; + while (*cp++ != '\0') + ; + } + if (id == NR_DEVICES) { + id = free_id; + if (id == 0) { + /* + * All pci irq counters are in use, perhaps because + * config is old so there aren't any. Abuse the + * clk0 counter. + */ + printf ( + "pcibus_ihandler_attach: counting pci irq%d's as clk0 irqs\n", + irq); + } + } result = register_intr( irq, /* isa irq */ - 0, /* deviced?? */ + id, /* device id */ 0, /* flags? */ func, /* handler */ maskptr, /* mask pointer */ diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c index bfa8899..b4c3b8a 100644 --- a/sys/i386/pci/pci_pir.c +++ b/sys/i386/pci/pci_pir.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: pcibus.c,v 1.20 1995/12/10 13:39:04 phk Exp $ +** $Id: pcibus.c,v 1.21 1995/12/16 00:27:59 bde Exp $ ** ** pci bus subroutines for i386 architecture. ** @@ -35,6 +35,8 @@ *************************************************************************** */ +#include "vector.h" + #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -425,10 +427,35 @@ pcibus_write (pcici_t tag, u_long reg, u_long data) static int pcibus_ihandler_attach (int irq, inthand2_t *func, int arg, unsigned * maskptr) { - int result; + char buf[16]; + char *cp; + int free_id, id, result; + + sprintf(buf, "pci irq%d", irq); + for (cp = intrnames, free_id = 0, id = 0; id < NR_DEVICES; id++) { + if (strcmp(cp, buf) == 0) + break; + if (free_id <= 0 && strcmp(cp, "pci irqnn") == 0) + free_id = id; + while (*cp++ != '\0') + ; + } + if (id == NR_DEVICES) { + id = free_id; + if (id == 0) { + /* + * All pci irq counters are in use, perhaps because + * config is old so there aren't any. Abuse the + * clk0 counter. + */ + printf ( + "pcibus_ihandler_attach: counting pci irq%d's as clk0 irqs\n", + irq); + } + } result = register_intr( irq, /* isa irq */ - 0, /* deviced?? */ + id, /* device id */ 0, /* flags? */ func, /* handler */ maskptr, /* mask pointer */ |