diff --git a/sys/arch/bebox/pci/pci_machdep.c b/sys/arch/bebox/pci/pci_machdep.c index ccfc7b1d08a2..cbd8662aa283 100644 --- a/sys/arch/bebox/pci/pci_machdep.c +++ b/sys/arch/bebox/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.c,v 1.8 2000/12/28 22:59:08 sommerfeld Exp $ */ +/* $NetBSD: pci_machdep.c,v 1.9 2001/02/12 06:01:46 briggs Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include +#define _BEBOX_BUS_DMA_PRIVATE #include #include #include @@ -58,9 +60,27 @@ #include #include #include +#include #include +struct bebox_bus_dma_tag pci_bus_dma_tag = { + 0, /* _bounce_thresh */ + _bus_dmamap_create, + _bus_dmamap_destroy, + _bus_dmamap_load, + _bus_dmamap_load_mbuf, + _bus_dmamap_load_uio, + _bus_dmamap_load_raw, + _bus_dmamap_unload, + NULL, /* _dmamap_sync */ + _bus_dmamem_alloc, + _bus_dmamem_free, + _bus_dmamem_map, + _bus_dmamem_unmap, + _bus_dmamem_mmap, +}; + #define PCI_MODE1_ENABLE 0x80000000UL #define PCI_MODE1_ADDRESS_REG (BEBOX_BUS_SPACE_IO + 0x0cf8) #define PCI_MODE1_DATA_REG (BEBOX_BUS_SPACE_IO + 0x0cfc) @@ -233,7 +253,7 @@ pci_intr_establish(pc, ih, level, func, arg) if (ih == 0 || ih >= ICU_LEN || ih == IRQ_SLAVE) panic("pci_intr_establish: bogus handle 0x%x\n", ih); - return isa_intr_establish(NULL, ih, IST_LEVEL, level, func, arg); + return (void *)intr_establish(ih, IST_LEVEL, level, func, arg); } void @@ -242,5 +262,22 @@ pci_intr_disestablish(pc, cookie) void *cookie; { - return isa_intr_disestablish(NULL, cookie); + intr_disestablish(cookie); +} + +void +pci_conf_interrupt(pci_chipset_tag_t pc, int bus, int dev, int func, + int swiz, int *iline) +{ + if (bus == 0) { + switch (dev) { + case 12: /* SCSI is bit 10, mapped to IRQ 20 */ + case 13: /* PCI slot 1 is bit 11, mapped to IRQ 21 */ + case 14: /* PCI slot 2 is bit 12, mapped to IRQ 22 */ + case 15: /* PCI slot 3 is bit 13, mapped to IRQ 23 */ + *iline = dev + 8; + } + } else { + *iline = 20 + ((swiz + dev + 1) & 3); + } }