summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-01-15 10:00:12 +0000
committerbde <bde@FreeBSD.org>1999-01-15 10:00:12 +0000
commitefd89902e69344c897e0ab130499f753ab63961e (patch)
treeafdeaf055dd51acae55d1045b318d85abe14c24c /sys
parent836496c3c77585a9603b1ce20cc257c7eb818729 (diff)
downloadFreeBSD-src-efd89902e69344c897e0ab130499f753ab63961e.zip
FreeBSD-src-efd89902e69344c897e0ab130499f753ab63961e.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/NOTES3
-rw-r--r--sys/conf/options3
-rw-r--r--sys/dev/cy/cy_pci.c15
-rw-r--r--sys/i386/conf/LINT3
-rw-r--r--sys/i386/conf/NOTES3
-rw-r--r--sys/pci/cy_pci.c15
6 files changed, 34 insertions, 8 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 14c2c93..634af92 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -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
diff --git a/sys/conf/options b/sys/conf/options
index ab47e37..5dd760c 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -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
diff --git a/sys/dev/cy/cy_pci.c b/sys/dev/cy/cy_pci.c
index 4f1b8b7..7113155 100644
--- a/sys/dev/cy/cy_pci.c
+++ b/sys/dev/cy/cy_pci.c
@@ -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.
diff --git a/sys/i386/conf/LINT b/sys/i386/conf/LINT
index 14c2c93..634af92 100644
--- a/sys/i386/conf/LINT
+++ b/sys/i386/conf/LINT
@@ -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
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 14c2c93..634af92 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -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
diff --git a/sys/pci/cy_pci.c b/sys/pci/cy_pci.c
index 4f1b8b7..7113155 100644
--- a/sys/pci/cy_pci.c
+++ b/sys/pci/cy_pci.c
@@ -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.
OpenPOWER on IntegriCloud