evcount_attach(&ih->ih_count, name, (void *)&ih->ih_irq, &evcount_intr);
isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, name)	isa_chipset_tag_t ic;	int irq;	int type;	int level;	int (*ih_fun) (void *);	void *ih_arg;	char *name;{    	struct intrq *iq;	struct intrhand *ih;	u_int oldirqstate;#if 0	printf("isa_intr_establish(%d, %d, %d)\n", irq, type, level);#endif	/* no point in sleeping unless someone can free memory. */	ih = malloc(sizeof *ih, M_DEVBUF, cold ? M_NOWAIT : M_WAITOK);	if (ih == NULL)	    return (NULL);	if (!LEGAL_IRQ(irq) || type == IST_NONE)		panic("intr_establish: bogus irq or type");	iq = &isa_intrq[irq];	switch (iq->iq_ist) {	case IST_NONE:		iq->iq_ist = type;#if 0		printf("Setting irq %d to type %d - ", irq, type);#endif		if (irq < 8) {			outb(0x4d0, (inb(0x4d0) & ~(1 << irq))			    | ((type == IST_LEVEL) ? (1 << irq) : 0));/*			printf("%02x\n", inb(0x4d0));*/		} else {			outb(0x4d1, (inb(0x4d1) & ~(1 << irq))			    | ((type == IST_LEVEL) ? (1 << irq) : 0));/*			printf("%02x\n", inb(0x4d1));*/		}		break;	case IST_EDGE:	case IST_LEVEL:		if (iq->iq_ist == type)			break;	case IST_PULSE:		if (type != IST_NONE)			panic("intr_establish: can't share %s with %s",			    isa_intr_typename(iq->iq_ist),			    isa_intr_typename(type));		break;	}	ih->ih_func = ih_fun;	ih->ih_arg = ih_arg;	ih->ih_ipl = level;	ih->ih_irq = irq;	/* do not stop us */	oldirqstate = disable_interrupts(I32_bit);		TAILQ_INSERT_TAIL(&iq->iq_list, ih, ih_list);	intr_calculatemasks();	restore_interrupts(oldirqstate);			return (ih);}