summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci_compat.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1999-05-11 15:28:38 +0000
committerpeter <peter@FreeBSD.org>1999-05-11 15:28:38 +0000
commit7ee1cc6f29e8c796ceb3e7a8f1eb3d29db7de654 (patch)
tree8f06c804b18d78766e2a196e5528db67458e851e /sys/pci/pci_compat.c
parent280d1557df645370bda158b38bee46e71fa7a8fa (diff)
downloadFreeBSD-src-7ee1cc6f29e8c796ceb3e7a8f1eb3d29db7de654.zip
FreeBSD-src-7ee1cc6f29e8c796ceb3e7a8f1eb3d29db7de654.tar.gz
Take a shot at handling INTR_FAST and INTR_EXCL for CY_PCI_FASTINTR.
Bruce suggested a patch before but that was based on the old DRIVER_TYPE_* interfaces.
Diffstat (limited to 'sys/pci/pci_compat.c')
-rw-r--r--sys/pci/pci_compat.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/sys/pci/pci_compat.c b/sys/pci/pci_compat.c
index f731eb0..4c146cc 100644
--- a/sys/pci/pci_compat.c
+++ b/sys/pci/pci_compat.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci_compat.c,v 1.26 1999/05/08 21:59:41 dfr Exp $
+ * $Id: pci_compat.c,v 1.27 1999/05/10 16:06:32 peter Exp $
*
*/
@@ -50,14 +50,15 @@
#include <pci/pcireg.h>
#include <pci/pcivar.h>
-#ifdef RESOURCE_CHECK
-#include <sys/drvresource.h>
-#endif
-
#ifdef APIC_IO
#include <machine/smp.h>
#endif
+#ifdef __i386__
+#include <i386/isa/intr_machdep.h>
+#endif
+
+
#ifdef PCI_COMPAT
/* ------------------------------------------------------------------------- */
@@ -157,7 +158,7 @@ pci_map_int(pcici_t cfg, pci_inthand_t *handler, void *arg, intrmask_t *maskptr)
int
pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
- intrmask_t *maskptr, u_int flags)
+ intrmask_t *maskptr, u_int intflags)
{
int error;
#ifdef APIC_IO
@@ -168,10 +169,18 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
int rid = 0;
struct resource *res;
int flags = 0;
+ int resflags = RF_SHAREABLE|RF_ACTIVE;
void *ih;
+#ifdef INTR_FAST
+ if (intflags & INTR_FAST)
+ flags |= INTR_FAST;
+ if (intflags & INTR_EXCL)
+ resflags &= ~RF_SHAREABLE;
+#endif
+
res = bus_alloc_resource(cfg->dev, SYS_RES_IRQ, &rid,
- irq, irq, 1, RF_SHAREABLE|RF_ACTIVE);
+ irq, irq, 1, resflags);
if (!res) {
printf("pci_map_int: can't allocate interrupt\n");
return 0;
@@ -181,13 +190,13 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
* This is ugly. Translate the mask into an interrupt type.
*/
if (maskptr == &tty_imask)
- flags = INTR_TYPE_TTY;
+ flags |= INTR_TYPE_TTY;
else if (maskptr == &bio_imask)
- flags = INTR_TYPE_BIO;
+ flags |= INTR_TYPE_BIO;
else if (maskptr == &net_imask)
- flags = INTR_TYPE_NET;
+ flags |= INTR_TYPE_NET;
else if (maskptr == &cam_imask)
- flags = INTR_TYPE_CAM;
+ flags |= INTR_TYPE_CAM;
error = BUS_SETUP_INTR(device_get_parent(cfg->dev), cfg->dev,
res, flags, handler, arg, &ih);
@@ -234,7 +243,7 @@ pci_map_int_right(pcici_t cfg, pci_inthand_t *handler, void *arg,
rid = 0;
res = bus_alloc_resource(cfg->dev, SYS_RES_IRQ, &rid,
nextpin, nextpin, 1,
- RF_SHAREABLE|RF_ACTIVE);
+ resflags);
if (!res) {
printf("pci_map_int: can't allocate extra interrupt\n");
return 0;
OpenPOWER on IntegriCloud