void *dec_6600_intr_establish __P(( void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *)); const char *dec_6600_intr_string(void *, pci_intr_handle_t); int dec_6600_intr_line(void *, pci_intr_handle_t); const struct evcnt *dec_6600_intr_evcnt(void *, pci_intr_handle_t); int dec_6600_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *); void *dec_6600_pciide_compat_intr_establish __P((void *, struct device *, struct pci_attach_args *, int, int (*)(void *), void *)); void  dec_6600_pciide_compat_intr_disestablish(void *, void *);  struct alpha_shared_intr *dec_6600_pci_intr;  void dec_6600_iointr(void *framep, unsigned long vec); extern void dec_6600_intr_enable(int irq); extern void dec_6600_intr_disable(int irq);  void pci_6600_pickintr(pcp) struct tsp_config *pcp; { bus_space_tag_t iot = &pcp->pc_iot; pci_chipset_tag_t pc = &pcp->pc_pc; #if 0 char *cp; #endif int i;  pc->pc_intr_v = pcp; pc->pc_intr_map = dec_6600_intr_map; pc->pc_intr_string = dec_6600_intr_string; pc->pc_intr_line = dec_6600_intr_line; #if 0 pc->pc_intr_evcnt = dec_6600_intr_evcnt; #endif pc->pc_intr_establish = dec_6600_intr_establish; pc->pc_intr_disestablish = dec_6600_intr_disestablish; pc->pc_pciide_compat_intr_establish = NULL;   if (dec_6600_pci_intr == NULL) { sioprimary = pcp; pc->pc_pciide_compat_intr_establish = dec_6600_pciide_compat_intr_establish; dec_6600_pci_intr = alpha_shared_intr_alloc(PCI_NIRQ); for (i = 0; i < PCI_NIRQ; i++) { alpha_shared_intr_set_maxstrays(dec_6600_pci_intr, i, PCI_STRAY_MAX); alpha_shared_intr_set_private(dec_6600_pci_intr, i, sioprimary);  #if 0 cp = alpha_shared_intr_string(dec_6600_pci_intr); sprintf(cp, "irq %d", i); evcnt_attach_dynamic(alpha_shared_intr_evcnt( dec_6600_pci_intr, 1), EVCNT_TYPE_INTR, NULL, "dec_6600", cp); #endif } #if NSIO sio_intr_setup(pc, iot); dec_6600_intr_enable(55);	 #endif set_iointr(dec_6600_iointr); } }  int dec_6600_intr_map(acv, bustag, buspin, line, ihp) void *acv; pcitag_t bustag; int buspin, line; pci_intr_handle_t *ihp; { struct tsp_config *pcp = acv; pci_chipset_tag_t pc = &pcp->pc_pc; int bus, device, function;  if (buspin == 0) {  return 1; } if (buspin > 4) { printf("intr_map: bad interrupt pin %d\n", buspin); return 1; }  alpha_pci_decompose_tag(pc, bustag, &bus, &device, &function);   if (line == 0xff) { printf("dec_6600_intr_map: no mapping for %d/%d/%d\n", bus, device, function); return (1); }  #if NSIO == 0 if (DEC_6600_LINE_IS_ISA(line)) { printf("dec_6600_intr_map: ISA IRQ %d for %d/%d/%d\n", DEC_6600_LINE_ISA_IRQ(line), bus, device, function); return (1); } #endif  if (DEC_6600_LINE_IS_ISA(line) == 0 && line >= PCI_NIRQ) panic("dec_6600_intr_map: dec 6600 irq too large (%d)\n", line);  *ihp = line; return (0); }  const char * dec_6600_intr_string(acv, ih) void *acv; pci_intr_handle_t ih; {  static const char irqfmt[] = "dec 6600 irq %ld"; static char irqstr[sizeof irqfmt];  #if NSIO if (DEC_6600_LINE_IS_ISA(ih)) return (sio_intr_string(NULL , DEC_6600_LINE_ISA_IRQ(ih))); #endif  snprintf(irqstr, sizeof irqstr, irqfmt, ih); return (irqstr); }  int dec_6600_intr_line(acv, ih) void *acv; pci_intr_handle_t ih; {  #if NSIO if (DEC_6600_LINE_IS_ISA(ih)) return (sio_intr_line(NULL , DEC_6600_LINE_ISA_IRQ(ih))); #endif  return (ih); }  #if 0 const struct evcnt * dec_6600_intr_evcnt(acv, ih) void *acv; pci_intr_handle_t ih; {  #if NSIO if (DEC_6600_LINE_IS_ISA(ih)) return (sio_intr_evcnt(NULL , DEC_6600_LINE_ISA_IRQ(ih))); #endif  return (alpha_shared_intr_evcnt(dec_6600_pci_intr, ih)); } #endif  void *
void *dec_6600_intr_establish __P((    void *, pci_intr_handle_t, int, int (*func)(void *), void *, char *));const char *dec_6600_intr_string(void *, pci_intr_handle_t);int dec_6600_intr_line(void *, pci_intr_handle_t);const struct evcnt *dec_6600_intr_evcnt(void *, pci_intr_handle_t);int dec_6600_intr_map(void *, pcitag_t, int, int, pci_intr_handle_t *);void *dec_6600_pciide_compat_intr_establish __P((void *, struct device *,    struct pci_attach_args *, int, int (*)(void *), void *));void  dec_6600_pciide_compat_intr_disestablish(void *, void *);struct alpha_shared_intr *dec_6600_pci_intr;void dec_6600_iointr(void *framep, unsigned long vec);extern void dec_6600_intr_enable(int irq);extern void dec_6600_intr_disable(int irq);voidpci_6600_pickintr(pcp)	struct tsp_config *pcp;{	bus_space_tag_t iot = &pcp->pc_iot;	pci_chipset_tag_t pc = &pcp->pc_pc;#if 0	char *cp;#endif	int i;        pc->pc_intr_v = pcp;        pc->pc_intr_map = dec_6600_intr_map;        pc->pc_intr_string = dec_6600_intr_string;        pc->pc_intr_line = dec_6600_intr_line;#if 0	pc->pc_intr_evcnt = dec_6600_intr_evcnt;#endif        pc->pc_intr_establish = dec_6600_intr_establish;        pc->pc_intr_disestablish = dec_6600_intr_disestablish;	pc->pc_pciide_compat_intr_establish = NULL;	/*	 * System-wide and Pchip-0-only logic...	 */	if (dec_6600_pci_intr == NULL) {		sioprimary = pcp;		pc->pc_pciide_compat_intr_establish =		    dec_6600_pciide_compat_intr_establish;		dec_6600_pci_intr = alpha_shared_intr_alloc(PCI_NIRQ);		for (i = 0; i < PCI_NIRQ; i++) {			alpha_shared_intr_set_maxstrays(dec_6600_pci_intr, i,			    PCI_STRAY_MAX);			alpha_shared_intr_set_private(dec_6600_pci_intr, i,			    sioprimary);#if 0			cp = alpha_shared_intr_string(dec_6600_pci_intr);			sprintf(cp, "irq %d", i);			evcnt_attach_dynamic(alpha_shared_intr_evcnt(			    dec_6600_pci_intr, 1), EVCNT_TYPE_INTR, NULL,			    "dec_6600", cp);#endif		}#if NSIO		sio_intr_setup(pc, iot);		dec_6600_intr_enable(55);	/* irq line for sio */#endif		set_iointr(dec_6600_iointr);	}}int     dec_6600_intr_map(acv, bustag, buspin, line, ihp)        void *acv;        pcitag_t bustag;         int buspin, line;        pci_intr_handle_t *ihp;{	struct tsp_config *pcp = acv;	pci_chipset_tag_t pc = &pcp->pc_pc;	int bus, device, function;	if (buspin == 0) {		/* No IRQ used. */		return 1;	}	if (buspin > 4) {		printf("intr_map: bad interrupt pin %d\n", buspin);		return 1;	}	alpha_pci_decompose_tag(pc, bustag, &bus, &device, &function);	/*	 * The console places the interrupt mapping in the "line" value.	 * A value of (char)-1 indicates there is no mapping.	 */	if (line == 0xff) {		printf("dec_6600_intr_map: no mapping for %d/%d/%d\n",		    bus, device, function);		return (1);	}#if NSIO == 0	if (DEC_6600_LINE_IS_ISA(line)) {		printf("dec_6600_intr_map: ISA IRQ %d for %d/%d/%d\n",		    DEC_6600_LINE_ISA_IRQ(line), bus, device, function);		return (1);	}#endif	if (DEC_6600_LINE_IS_ISA(line) == 0 && line >= PCI_NIRQ)		panic("dec_6600_intr_map: dec 6600 irq too large (%d)\n",		    line);	*ihp = line;	return (0);}const char *dec_6600_intr_string(acv, ih)	void *acv;	pci_intr_handle_t ih;{	static const char irqfmt[] = "dec 6600 irq %ld";	static char irqstr[sizeof irqfmt];#if NSIO	if (DEC_6600_LINE_IS_ISA(ih))		return (sio_intr_string(NULL /*XXX*/,		    DEC_6600_LINE_ISA_IRQ(ih)));#endif	snprintf(irqstr, sizeof irqstr, irqfmt, ih);	return (irqstr);}intdec_6600_intr_line(acv, ih)	void *acv;	pci_intr_handle_t ih;{#if NSIO	if (DEC_6600_LINE_IS_ISA(ih))		return (sio_intr_line(NULL /*XXX*/,		    DEC_6600_LINE_ISA_IRQ(ih)));#endif	return (ih);}#if 0const struct evcnt *dec_6600_intr_evcnt(acv, ih)	void *acv;	pci_intr_handle_t ih;{#if NSIO	if (DEC_6600_LINE_IS_ISA(ih))		return (sio_intr_evcnt(NULL /*XXX*/,		    DEC_6600_LINE_ISA_IRQ(ih)));#endif	return (alpha_shared_intr_evcnt(dec_6600_pci_intr, ih));}#endifvoid *dec_6600_intr_establish(acv, ih, level, func, arg, name)        void *acv, *arg;        pci_intr_handle_t ih;        int level;        int (*func)(void *);	char *name;{	void *cookie;#if NSIO	if (DEC_6600_LINE_IS_ISA(ih))		return (sio_intr_establish(NULL /*XXX*/,		    DEC_6600_LINE_ISA_IRQ(ih), IST_LEVEL, level, func, arg,	            name));#endif	if (ih >= PCI_NIRQ)		panic("dec_6600_intr_establish: bogus dec 6600 IRQ 0x%lx\n",		    ih);	cookie = alpha_shared_intr_establish(dec_6600_pci_intr, ih, IST_LEVEL,	    level, func, arg, name);	if (cookie != NULL && alpha_shared_intr_isactive(dec_6600_pci_intr, ih))		dec_6600_intr_enable(ih);	return (cookie);}