Home | History | Annotate | Line # | Download | only in pci
pci_machdep.c revision 1.8
      1  1.8  sommerfe /*	$NetBSD: pci_machdep.c,v 1.8 2000/12/28 22:59:10 sommerfeld Exp $	*/
      2  1.1    nonaka 
      3  1.1    nonaka /*
      4  1.1    nonaka  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
      5  1.1    nonaka  * Copyright (c) 1994 Charles M. Hannum.  All rights reserved.
      6  1.1    nonaka  *
      7  1.1    nonaka  * Redistribution and use in source and binary forms, with or without
      8  1.1    nonaka  * modification, are permitted provided that the following conditions
      9  1.1    nonaka  * are met:
     10  1.1    nonaka  * 1. Redistributions of source code must retain the above copyright
     11  1.1    nonaka  *    notice, this list of conditions and the following disclaimer.
     12  1.1    nonaka  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1    nonaka  *    notice, this list of conditions and the following disclaimer in the
     14  1.1    nonaka  *    documentation and/or other materials provided with the distribution.
     15  1.1    nonaka  * 3. All advertising materials mentioning features or use of this software
     16  1.1    nonaka  *    must display the following acknowledgement:
     17  1.1    nonaka  *	This product includes software developed by Charles M. Hannum.
     18  1.1    nonaka  * 4. The name of the author may not be used to endorse or promote products
     19  1.1    nonaka  *    derived from this software without specific prior written permission.
     20  1.1    nonaka  *
     21  1.1    nonaka  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  1.1    nonaka  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  1.1    nonaka  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  1.1    nonaka  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  1.1    nonaka  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  1.1    nonaka  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  1.1    nonaka  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  1.1    nonaka  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  1.1    nonaka  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  1.1    nonaka  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  1.1    nonaka  */
     32  1.1    nonaka 
     33  1.1    nonaka /*
     34  1.1    nonaka  * Machine-specific functions for PCI autoconfiguration.
     35  1.1    nonaka  *
     36  1.1    nonaka  * On PCs, there are two methods of generating PCI configuration cycles.
     37  1.1    nonaka  * We try to detect the appropriate mechanism for this machine and set
     38  1.1    nonaka  * up a few function pointers to access the correct method directly.
     39  1.1    nonaka  */
     40  1.1    nonaka 
     41  1.1    nonaka #include <sys/types.h>
     42  1.1    nonaka #include <sys/param.h>
     43  1.1    nonaka #include <sys/time.h>
     44  1.1    nonaka #include <sys/systm.h>
     45  1.1    nonaka #include <sys/errno.h>
     46  1.1    nonaka #include <sys/device.h>
     47  1.1    nonaka 
     48  1.6       mrg #include <uvm/uvm_extern.h>
     49  1.1    nonaka 
     50  1.1    nonaka #define _PREP_BUS_DMA_PRIVATE
     51  1.1    nonaka #include <machine/bus.h>
     52  1.1    nonaka #include <machine/pio.h>
     53  1.1    nonaka #include <machine/intr.h>
     54  1.1    nonaka 
     55  1.1    nonaka #include <dev/isa/isavar.h>
     56  1.1    nonaka #include <dev/pci/pcivar.h>
     57  1.1    nonaka #include <dev/pci/pcireg.h>
     58  1.1    nonaka #include <dev/pci/pcidevs.h>
     59  1.1    nonaka 
     60  1.1    nonaka #define	PCI_MODE1_ENABLE	0x80000000UL
     61  1.2    nonaka #define	PCI_MODE1_ADDRESS_REG	(PREP_BUS_SPACE_IO + 0xcf8)
     62  1.2    nonaka #define	PCI_MODE1_DATA_REG	(PREP_BUS_SPACE_IO + 0xcfc)
     63  1.1    nonaka 
     64  1.4    nonaka #define	o2i(off)	((off)/sizeof(pcireg_t))
     65  1.1    nonaka 
     66  1.1    nonaka /*
     67  1.1    nonaka  * PCI doesn't have any special needs; just use the generic versions
     68  1.1    nonaka  * of these functions.
     69  1.1    nonaka  */
     70  1.1    nonaka struct prep_bus_dma_tag pci_bus_dma_tag = {
     71  1.1    nonaka 	0,			/* _bounce_thresh */
     72  1.1    nonaka 	_bus_dmamap_create,
     73  1.1    nonaka 	_bus_dmamap_destroy,
     74  1.1    nonaka 	_bus_dmamap_load,
     75  1.1    nonaka 	_bus_dmamap_load_mbuf,
     76  1.1    nonaka 	_bus_dmamap_load_uio,
     77  1.1    nonaka 	_bus_dmamap_load_raw,
     78  1.1    nonaka 	_bus_dmamap_unload,
     79  1.1    nonaka 	NULL,			/* _dmamap_sync */
     80  1.1    nonaka 	_bus_dmamem_alloc,
     81  1.1    nonaka 	_bus_dmamem_free,
     82  1.1    nonaka 	_bus_dmamem_map,
     83  1.1    nonaka 	_bus_dmamem_unmap,
     84  1.1    nonaka 	_bus_dmamem_mmap,
     85  1.1    nonaka };
     86  1.1    nonaka 
     87  1.1    nonaka void
     88  1.1    nonaka pci_attach_hook(parent, self, pba)
     89  1.1    nonaka 	struct device *parent, *self;
     90  1.1    nonaka 	struct pcibus_attach_args *pba;
     91  1.1    nonaka {
     92  1.1    nonaka 	pci_chipset_tag_t pc;
     93  1.1    nonaka 	int bus, device, maxndevs, function, nfunctions;
     94  1.4    nonaka 	int iq = 2;		/* fixup ioaddr: 0x02000000~ */
     95  1.4    nonaka 	int mq = 1;		/* fixup memaddr: 0x01000000~ */
     96  1.1    nonaka 
     97  1.1    nonaka 	pc = pba->pba_pc;
     98  1.1    nonaka 	bus = pba->pba_bus;
     99  1.1    nonaka 
    100  1.1    nonaka 	maxndevs = pci_bus_maxdevs(pba->pba_pc, pba->pba_bus);
    101  1.1    nonaka 
    102  1.1    nonaka 	for (device = 0; device < maxndevs; device++) {
    103  1.1    nonaka 		pcitag_t tag;
    104  1.4    nonaka 		pcireg_t id, intr, bhlcr, csr, adr;
    105  1.1    nonaka 		int line;
    106  1.1    nonaka 
    107  1.1    nonaka 		tag = pci_make_tag(pc, bus, device, 0);
    108  1.1    nonaka 		id = pci_conf_read(pc, tag, PCI_ID_REG);
    109  1.1    nonaka 
    110  1.1    nonaka 		/* Invalid vendor ID value? */
    111  1.1    nonaka 		if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
    112  1.1    nonaka 			continue;
    113  1.1    nonaka 		/* XXX Not invalid, but we've done this ~forever. */
    114  1.1    nonaka 		if (PCI_VENDOR(id) == 0)
    115  1.1    nonaka 			continue;
    116  1.1    nonaka 
    117  1.1    nonaka 		bhlcr = pci_conf_read(pc, tag, PCI_BHLC_REG);
    118  1.1    nonaka 		if (PCI_HDRTYPE_MULTIFN(bhlcr))
    119  1.1    nonaka 			nfunctions = 8;
    120  1.1    nonaka 		else
    121  1.1    nonaka 			nfunctions = 1;
    122  1.1    nonaka 
    123  1.1    nonaka 		for (function = 0; function < nfunctions; function++) {
    124  1.4    nonaka 			pcireg_t regs[256/sizeof(pcireg_t)];
    125  1.4    nonaka 			pcireg_t mask;
    126  1.4    nonaka 			pcireg_t rval;
    127  1.4    nonaka 			int off;
    128  1.4    nonaka 			int memfound, iofound;
    129  1.1    nonaka 
    130  1.1    nonaka 			tag = pci_make_tag(pc, bus, device, function);
    131  1.1    nonaka 			id = pci_conf_read(pc, tag, PCI_ID_REG);
    132  1.1    nonaka 
    133  1.1    nonaka 			/* Invalid vendor ID value? */
    134  1.1    nonaka 			if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
    135  1.1    nonaka                                 continue;
    136  1.1    nonaka 			/* XXX Not invalid, but we've done this ~forever. */
    137  1.1    nonaka 			if (PCI_VENDOR(id) == 0)
    138  1.1    nonaka 				continue;
    139  1.1    nonaka 
    140  1.1    nonaka 			/* Enable io/mem */
    141  1.4    nonaka 			memfound = 0;
    142  1.4    nonaka 			iofound = 0;
    143  1.4    nonaka 			for (off = 0; off < 256; off += sizeof(pcireg_t))
    144  1.4    nonaka 				regs[o2i(off)] = pci_conf_read(pc, tag, off);
    145  1.4    nonaka 			/* is it a std device header? */
    146  1.4    nonaka 			if (PCI_HDRTYPE_TYPE(regs[o2i(PCI_BHLC_REG)]) != 0)
    147  1.4    nonaka 				continue;
    148  1.4    nonaka 			for (off = PCI_MAPREG_START;
    149  1.4    nonaka 			    off < PCI_MAPREG_END; off += sizeof(pcireg_t)) {
    150  1.4    nonaka 				rval = regs[o2i(off)];
    151  1.4    nonaka 				if (rval != 0) {
    152  1.4    nonaka 					pci_conf_write(pc, tag, off, 0xffffffff);
    153  1.4    nonaka 					mask = pci_conf_read(pc, tag, off);
    154  1.4    nonaka 					pci_conf_write(pc, tag, off, rval);
    155  1.4    nonaka 				} else
    156  1.4    nonaka 					mask = 0;
    157  1.4    nonaka #ifdef DEBUG
    158  1.4    nonaka 				printf("\n");
    159  1.4    nonaka 				printf("dev %d func %d ", device, function);
    160  1.4    nonaka 				printf("off %02x addr %08x mask %08x",
    161  1.4    nonaka 				    off, rval, mask);
    162  1.4    nonaka #endif
    163  1.4    nonaka 				if (rval == 0)
    164  1.4    nonaka 					continue;
    165  1.4    nonaka 				/* find IO or MEM space */
    166  1.4    nonaka 				if (PCI_MAPREG_TYPE(rval) == PCI_MAPREG_TYPE_MEM)
    167  1.4    nonaka 					memfound = 1;
    168  1.4    nonaka 				else
    169  1.4    nonaka 					iofound = 1;
    170  1.4    nonaka 			}
    171  1.4    nonaka 			if (memfound) {
    172  1.4    nonaka 				csr = pci_conf_read(pc, tag,
    173  1.4    nonaka 				    PCI_COMMAND_STATUS_REG);
    174  1.4    nonaka 				csr |= PCI_COMMAND_MEM_ENABLE;
    175  1.4    nonaka 				pci_conf_write(pc, tag,
    176  1.4    nonaka 				    PCI_COMMAND_STATUS_REG, csr);
    177  1.4    nonaka #ifdef DEBUG
    178  1.4    nonaka 				printf("\n");
    179  1.4    nonaka 				printf("dev %d func %d: mem", device, function);
    180  1.4    nonaka #endif
    181  1.4    nonaka 			}
    182  1.4    nonaka 			if (iofound) {
    183  1.4    nonaka 				csr = pci_conf_read(pc, tag,
    184  1.4    nonaka 				    PCI_COMMAND_STATUS_REG);
    185  1.4    nonaka 				csr |= PCI_COMMAND_IO_ENABLE;
    186  1.4    nonaka 				pci_conf_write(pc, tag,
    187  1.4    nonaka 				    PCI_COMMAND_STATUS_REG, csr);
    188  1.4    nonaka #ifdef DEBUG
    189  1.4    nonaka 				printf("\n");
    190  1.4    nonaka 				printf("dev %d func %d: io", device, function);
    191  1.4    nonaka #endif
    192  1.1    nonaka 			}
    193  1.1    nonaka 
    194  1.2    nonaka 			/* Fixup insane address */
    195  1.4    nonaka 			for (off = PCI_MAPREG_START;
    196  1.4    nonaka 			    off < PCI_MAPREG_END; off += sizeof(pcireg_t)) {
    197  1.4    nonaka 				int need_fixup;
    198  1.4    nonaka 
    199  1.4    nonaka 				need_fixup = 0;
    200  1.4    nonaka 				adr = pci_conf_read(pc, tag, off);
    201  1.4    nonaka 				if (adr > 0x10000000 ||
    202  1.4    nonaka 				    (adr < 0x1000 && adr != 0))
    203  1.4    nonaka 					need_fixup = 1;
    204  1.4    nonaka 
    205  1.4    nonaka 				if (need_fixup) {
    206  1.4    nonaka #ifdef DEBUG
    207  1.4    nonaka 					printf("\n");
    208  1.4    nonaka 					printf("dev %d func %d %saddr %08x -> ",
    209  1.4    nonaka 					    device, function,
    210  1.4    nonaka 					    PCI_MAPREG_TYPE(adr) ==
    211  1.4    nonaka 					      PCI_MAPREG_TYPE_MEM ? "mem":"io",
    212  1.4    nonaka 					    adr);
    213  1.4    nonaka #endif
    214  1.4    nonaka 					adr &= 0x00ffffff;
    215  1.4    nonaka 					adr |= 0x01000000 *
    216  1.4    nonaka 					    (PCI_MAPREG_TYPE(adr) ==
    217  1.4    nonaka 					      PCI_MAPREG_TYPE_MEM ? mq++:iq++);
    218  1.4    nonaka #ifdef DEBUG
    219  1.4    nonaka 					printf("%08x", adr);
    220  1.4    nonaka #endif
    221  1.4    nonaka 					pci_conf_write(pc, tag, off, adr);
    222  1.2    nonaka 				}
    223  1.1    nonaka 			}
    224  1.1    nonaka 
    225  1.1    nonaka 			/* Fixup intr */
    226  1.7      matt #if 1
    227  1.1    nonaka 			/* XXX: ibm_machdep : ppc830 depend */
    228  1.1    nonaka 			switch (device) {
    229  1.1    nonaka 			case 12:
    230  1.1    nonaka 			case 18:
    231  1.1    nonaka 			case 22:
    232  1.1    nonaka 				line = 15;
    233  1.1    nonaka 				break;
    234  1.1    nonaka 			default:
    235  1.1    nonaka 				line = 0;
    236  1.1    nonaka 				break;
    237  1.1    nonaka 			}
    238  1.1    nonaka 
    239  1.1    nonaka 			if (line) {
    240  1.2    nonaka 				intr = pci_conf_read(pc, tag, PCI_INTERRUPT_REG);
    241  1.2    nonaka 				pci_conf_write(pc, tag, PCI_INTERRUPT_REG,
    242  1.2    nonaka 				    (intr & ~0xff) | line);
    243  1.1    nonaka 			}
    244  1.7      matt #endif
    245  1.1    nonaka 		}
    246  1.1    nonaka 	}
    247  1.1    nonaka }
    248  1.1    nonaka 
    249  1.1    nonaka int
    250  1.1    nonaka pci_bus_maxdevs(pc, busno)
    251  1.1    nonaka 	pci_chipset_tag_t pc;
    252  1.1    nonaka 	int busno;
    253  1.1    nonaka {
    254  1.1    nonaka 
    255  1.1    nonaka 	/*
    256  1.1    nonaka 	 * Bus number is irrelevant.  Configuration Mechanism 1 is in
    257  1.1    nonaka 	 * use, can have devices 0-32 (i.e. the `normal' range).
    258  1.1    nonaka 	 */
    259  1.1    nonaka 	return (32);
    260  1.1    nonaka }
    261  1.1    nonaka 
    262  1.1    nonaka pcitag_t
    263  1.1    nonaka pci_make_tag(pc, bus, device, function)
    264  1.1    nonaka 	pci_chipset_tag_t pc;
    265  1.1    nonaka 	int bus, device, function;
    266  1.1    nonaka {
    267  1.1    nonaka 	pcitag_t tag;
    268  1.1    nonaka 
    269  1.1    nonaka 	if (bus >= 256 || device >= 32 || function >= 8)
    270  1.1    nonaka 		panic("pci_make_tag: bad request");
    271  1.1    nonaka 
    272  1.1    nonaka 	tag = PCI_MODE1_ENABLE |
    273  1.1    nonaka 		    (bus << 16) | (device << 11) | (function << 8);
    274  1.1    nonaka 	return tag;
    275  1.1    nonaka }
    276  1.1    nonaka 
    277  1.1    nonaka void
    278  1.1    nonaka pci_decompose_tag(pc, tag, bp, dp, fp)
    279  1.1    nonaka 	pci_chipset_tag_t pc;
    280  1.1    nonaka 	pcitag_t tag;
    281  1.1    nonaka 	int *bp, *dp, *fp;
    282  1.1    nonaka {
    283  1.1    nonaka 
    284  1.1    nonaka 	if (bp != NULL)
    285  1.1    nonaka 		*bp = (tag >> 16) & 0xff;
    286  1.1    nonaka 	if (dp != NULL)
    287  1.1    nonaka 		*dp = (tag >> 11) & 0x1f;
    288  1.1    nonaka 	if (fp != NULL)
    289  1.1    nonaka 		*fp = (tag >> 8) & 0x7;
    290  1.1    nonaka 	return;
    291  1.1    nonaka }
    292  1.1    nonaka 
    293  1.1    nonaka pcireg_t
    294  1.1    nonaka pci_conf_read(pc, tag, reg)
    295  1.1    nonaka 	pci_chipset_tag_t pc;
    296  1.1    nonaka 	pcitag_t tag;
    297  1.1    nonaka 	int reg;
    298  1.1    nonaka {
    299  1.1    nonaka 	pcireg_t data;
    300  1.1    nonaka 
    301  1.1    nonaka 	out32rb(PCI_MODE1_ADDRESS_REG, tag | reg);
    302  1.1    nonaka 	data = in32rb(PCI_MODE1_DATA_REG);
    303  1.1    nonaka 	out32rb(PCI_MODE1_ADDRESS_REG, 0);
    304  1.1    nonaka 	return data;
    305  1.1    nonaka }
    306  1.1    nonaka 
    307  1.1    nonaka void
    308  1.1    nonaka pci_conf_write(pc, tag, reg, data)
    309  1.1    nonaka 	pci_chipset_tag_t pc;
    310  1.1    nonaka 	pcitag_t tag;
    311  1.1    nonaka 	int reg;
    312  1.1    nonaka 	pcireg_t data;
    313  1.1    nonaka {
    314  1.1    nonaka 
    315  1.1    nonaka 	out32rb(PCI_MODE1_ADDRESS_REG, tag | reg);
    316  1.1    nonaka 	out32rb(PCI_MODE1_DATA_REG, data);
    317  1.1    nonaka 	out32rb(PCI_MODE1_ADDRESS_REG, 0);
    318  1.1    nonaka }
    319  1.1    nonaka 
    320  1.1    nonaka int
    321  1.8  sommerfe pci_intr_map(pa, ihp)
    322  1.8  sommerfe 	struct pci_attach_args *pa;
    323  1.1    nonaka 	pci_intr_handle_t *ihp;
    324  1.1    nonaka {
    325  1.8  sommerfe 	int pin = pa->pa_intrpin;
    326  1.8  sommerfe 	int line = pa->pa_intrline;
    327  1.1    nonaka 
    328  1.1    nonaka 	if (pin == 0) {
    329  1.1    nonaka 		/* No IRQ used. */
    330  1.1    nonaka 		goto bad;
    331  1.1    nonaka 	}
    332  1.1    nonaka 
    333  1.1    nonaka 	if (pin > 4) {
    334  1.1    nonaka 		printf("pci_intr_map: bad interrupt pin %d\n", pin);
    335  1.1    nonaka 		goto bad;
    336  1.1    nonaka 	}
    337  1.1    nonaka 
    338  1.1    nonaka 	/*
    339  1.1    nonaka 	* Section 6.2.4, `Miscellaneous Functions', says that 255 means
    340  1.1    nonaka 	* `unknown' or `no connection' on a PC.  We assume that a device with
    341  1.1    nonaka 	* `no connection' either doesn't have an interrupt (in which case the
    342  1.1    nonaka 	* pin number should be 0, and would have been noticed above), or
    343  1.1    nonaka 	* wasn't configured by the BIOS (in which case we punt, since there's
    344  1.1    nonaka 	* no real way we can know how the interrupt lines are mapped in the
    345  1.1    nonaka 	* hardware).
    346  1.1    nonaka 	*
    347  1.1    nonaka 	* XXX
    348  1.1    nonaka 	* Since IRQ 0 is only used by the clock, and we can't actually be sure
    349  1.1    nonaka 	* that the BIOS did its job, we also recognize that as meaning that
    350  1.1    nonaka 	* the BIOS has not configured the device.
    351  1.1    nonaka 	*/
    352  1.1    nonaka 	if (line == 0 || line == 255) {
    353  1.1    nonaka 		printf("pci_intr_map: no mapping for pin %c\n", '@' + pin);
    354  1.1    nonaka 		goto bad;
    355  1.1    nonaka 	} else {
    356  1.1    nonaka 		if (line >= ICU_LEN) {
    357  1.1    nonaka 			printf("pci_intr_map: bad interrupt line %d\n", line);
    358  1.1    nonaka 			goto bad;
    359  1.1    nonaka 		}
    360  1.1    nonaka 		if (line == IRQ_SLAVE) {
    361  1.1    nonaka 			printf("pci_intr_map: changed line 2 to line 9\n");
    362  1.1    nonaka 			line = 9;
    363  1.1    nonaka 		}
    364  1.1    nonaka 	}
    365  1.1    nonaka 
    366  1.1    nonaka 	*ihp = line;
    367  1.1    nonaka 	return 0;
    368  1.1    nonaka 
    369  1.1    nonaka bad:
    370  1.1    nonaka 	*ihp = -1;
    371  1.1    nonaka 	return 1;
    372  1.1    nonaka }
    373  1.1    nonaka 
    374  1.1    nonaka const char *
    375  1.1    nonaka pci_intr_string(pc, ih)
    376  1.1    nonaka 	pci_chipset_tag_t pc;
    377  1.1    nonaka 	pci_intr_handle_t ih;
    378  1.1    nonaka {
    379  1.1    nonaka 	static char irqstr[8];		/* 4 + 2 + NULL + sanity */
    380  1.1    nonaka 
    381  1.1    nonaka 	if (ih == 0 || ih >= ICU_LEN || ih == IRQ_SLAVE)
    382  1.1    nonaka 		panic("pci_intr_string: bogus handle 0x%x\n", ih);
    383  1.1    nonaka 
    384  1.1    nonaka 	sprintf(irqstr, "irq %d", ih);
    385  1.1    nonaka 	return (irqstr);
    386  1.1    nonaka 
    387  1.3       cgd }
    388  1.3       cgd 
    389  1.3       cgd const struct evcnt *
    390  1.3       cgd pci_intr_evcnt(pc, ih)
    391  1.3       cgd 	pci_chipset_tag_t pc;
    392  1.3       cgd 	pci_intr_handle_t ih;
    393  1.3       cgd {
    394  1.3       cgd 
    395  1.3       cgd 	/* XXX for now, no evcnt parent reported */
    396  1.3       cgd 	return NULL;
    397  1.1    nonaka }
    398  1.1    nonaka 
    399  1.1    nonaka void *
    400  1.1    nonaka pci_intr_establish(pc, ih, level, func, arg)
    401  1.1    nonaka 	pci_chipset_tag_t pc;
    402  1.1    nonaka 	pci_intr_handle_t ih;
    403  1.1    nonaka 	int level, (*func) __P((void *));
    404  1.1    nonaka 	void *arg;
    405  1.1    nonaka {
    406  1.1    nonaka 
    407  1.1    nonaka 	if (ih == 0 || ih >= ICU_LEN || ih == IRQ_SLAVE)
    408  1.1    nonaka 		panic("pci_intr_establish: bogus handle 0x%x\n", ih);
    409  1.1    nonaka 
    410  1.1    nonaka 	return isa_intr_establish(NULL, ih, IST_LEVEL, level, func, arg);
    411  1.1    nonaka }
    412  1.1    nonaka 
    413  1.1    nonaka void
    414  1.1    nonaka pci_intr_disestablish(pc, cookie)
    415  1.1    nonaka 	pci_chipset_tag_t pc;
    416  1.1    nonaka 	void *cookie;
    417  1.1    nonaka {
    418  1.1    nonaka 
    419  1.1    nonaka 	return isa_intr_disestablish(NULL, cookie);
    420  1.1    nonaka }
    421