Use a fast interrupt handler for the PCI version of the cy driver

if option CY_PCI_FASTINTR is configured and mapping the irq to a
fastintr is possible.  Unfortunately, this has to be optional because
pci_map_int_right() doesn't handle the INTR_EXCL flag right --
INTR_EXCL is honoured even if the interrupt needs to be non-exclusive
for other devices to work.
This commit is contained in:
Bruce Evans 1999-01-15 10:00:12 +00:00
parent e93e63cb39
commit b8cf6ea776
6 changed files with 34 additions and 8 deletions

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.533 1999/01/11 17:44:06 eivind Exp $
# $Id: LINT,v 1.534 1999/01/13 09:55:19 yokota Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -1398,6 +1398,7 @@ device gsc0 at isa? port "IO_GSC1" tty drq 3
device joy0 at isa? port IO_GAME
device alog0 at isa? port 0x260 tty irq 5
device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000
options CY_PCI_FASTINTR # Use with cy_pci unless irq is shared
device dgb0 at isa? port 0x220 iomem 0xfc0000 iosiz ? tty
device dgm0 at isa? port 0x104 iomem 0xd00000 iosiz ? tty
device labpc0 at isa? port 0x260 tty irq 5

View File

@ -1,4 +1,4 @@
# $Id: options,v 1.117 1999/01/10 17:41:32 nsouch Exp $
# $Id: options,v 1.118 1999/01/14 03:30:48 kjc Exp $
#
# On the handling of kernel options
#
@ -44,6 +44,7 @@ ADW_ALLOW_MEMIO opt_adw.h # Allow PCI devices to use memory
COMPAT_43 opt_compat.h
COMPAT_SUNOS opt_compat.h
COMPILING_LINT opt_lint.h
CY_PCI_FASTINTR
DDB
DDB_UNATTENDED opt_ddb.h
GDB_REMOTE_CHAT opt_ddb.h

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: cy_pci.c,v 1.8 1999/01/11 23:35:01 bde Exp $
* $Id: cy_pci.c,v 1.9 1999/01/11 23:43:54 bde Exp $
*/
/*
@ -34,8 +34,11 @@
#include "pci.h"
#if NPCI > 0
#include "opt_cy_pci_fastintr.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@ -112,10 +115,18 @@ cy_attach(config_id, unit)
* since the ISA driver must handle the interrupt anyway, we use
* the unit number as the token even for PCI.
*/
if (!pci_map_int(config_id, (pci_inthand_t *)cyintr, (void *)adapter, &tty_imask)) {
if (
#ifdef CY_PCI_FASTINTR
!pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
(void *)adapter, &tty_imask,
INTR_EXCL | INTR_FAST) &&
#endif
!pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
(void *)adapter, &tty_imask, 0)) {
printf("cy%d: couldn't map interrupt\n", unit);
goto fail;
}
/*
* Enable the "local" interrupt input to generate a
* PCI interrupt.

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.533 1999/01/11 17:44:06 eivind Exp $
# $Id: LINT,v 1.534 1999/01/13 09:55:19 yokota Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -1398,6 +1398,7 @@ device gsc0 at isa? port "IO_GSC1" tty drq 3
device joy0 at isa? port IO_GAME
device alog0 at isa? port 0x260 tty irq 5
device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000
options CY_PCI_FASTINTR # Use with cy_pci unless irq is shared
device dgb0 at isa? port 0x220 iomem 0xfc0000 iosiz ? tty
device dgm0 at isa? port 0x104 iomem 0xd00000 iosiz ? tty
device labpc0 at isa? port 0x260 tty irq 5

View File

@ -2,7 +2,7 @@
# LINT -- config file for checking all the sources, tries to pull in
# as much of the source tree as it can.
#
# $Id: LINT,v 1.533 1999/01/11 17:44:06 eivind Exp $
# $Id: LINT,v 1.534 1999/01/13 09:55:19 yokota Exp $
#
# NB: You probably don't want to try running a kernel built from this
# file. Instead, you should start from GENERIC, and add options from
@ -1398,6 +1398,7 @@ device gsc0 at isa? port "IO_GSC1" tty drq 3
device joy0 at isa? port IO_GAME
device alog0 at isa? port 0x260 tty irq 5
device cy0 at isa? tty irq 10 iomem 0xd4000 iosiz 0x2000
options CY_PCI_FASTINTR # Use with cy_pci unless irq is shared
device dgb0 at isa? port 0x220 iomem 0xfc0000 iosiz ? tty
device dgm0 at isa? port 0x104 iomem 0xd00000 iosiz ? tty
device labpc0 at isa? port 0x260 tty irq 5

View File

@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: cy_pci.c,v 1.8 1999/01/11 23:35:01 bde Exp $
* $Id: cy_pci.c,v 1.9 1999/01/11 23:43:54 bde Exp $
*/
/*
@ -34,8 +34,11 @@
#include "pci.h"
#if NPCI > 0
#include "opt_cy_pci_fastintr.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@ -112,10 +115,18 @@ cy_attach(config_id, unit)
* since the ISA driver must handle the interrupt anyway, we use
* the unit number as the token even for PCI.
*/
if (!pci_map_int(config_id, (pci_inthand_t *)cyintr, (void *)adapter, &tty_imask)) {
if (
#ifdef CY_PCI_FASTINTR
!pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
(void *)adapter, &tty_imask,
INTR_EXCL | INTR_FAST) &&
#endif
!pci_map_int_right(config_id, (pci_inthand_t *)cyintr,
(void *)adapter, &tty_imask, 0)) {
printf("cy%d: couldn't map interrupt\n", unit);
goto fail;
}
/*
* Enable the "local" interrupt input to generate a
* PCI interrupt.