register struct zs_chanstate *a;
struct zs_chanstate *a;
zshard(intrarg)	void *intrarg;{	register struct zs_chanstate *a;#define	b (a + 1)	register volatile struct zschan *zc;	register int rr3, intflags = 0, v, i, ringmask;#define ZSHARD_NEED_SOFTINTR	1#define ZSHARD_WAS_SERVICED	2#define ZSHARD_CHIP_GOTINTR	4	for (a = zslist; a != NULL; a = b->cs_next) {		ringmask = a->cs_ringmask;		rr3 = ZS_READ(a->cs_zc, 3);		if (rr3 & (ZSRR3_IP_A_RX|ZSRR3_IP_A_TX|ZSRR3_IP_A_STAT)) {			intflags |= (ZSHARD_CHIP_GOTINTR|ZSHARD_WAS_SERVICED);			zc = a->cs_zc;			i = a->cs_rbput;			if (rr3 & ZSRR3_IP_A_RX && (v = zsrint(a, zc)) != 0) {				a->cs_rbuf[i++ & ringmask] = v;				intflags |= ZSHARD_NEED_SOFTINTR;			}			if (rr3 & ZSRR3_IP_A_TX && (v = zsxint(a, zc)) != 0) {				a->cs_rbuf[i++ & ringmask] = v;				intflags |= ZSHARD_NEED_SOFTINTR;			}			if (rr3 & ZSRR3_IP_A_STAT && (v = zssint(a, zc)) != 0) {				a->cs_rbuf[i++ & ringmask] = v;				intflags |= ZSHARD_NEED_SOFTINTR;			}			a->cs_rbput = i;		}		if (rr3 & (ZSRR3_IP_B_RX|ZSRR3_IP_B_TX|ZSRR3_IP_B_STAT)) {			intflags |= (ZSHARD_CHIP_GOTINTR|ZSHARD_WAS_SERVICED);			zc = b->cs_zc;			i = b->cs_rbput;			if (rr3 & ZSRR3_IP_B_RX && (v = zsrint(b, zc)) != 0) {				b->cs_rbuf[i++ & ringmask] = v;				intflags |= ZSHARD_NEED_SOFTINTR;			}			if (rr3 & ZSRR3_IP_B_TX && (v = zsxint(b, zc)) != 0) {				b->cs_rbuf[i++ & ringmask] = v;				intflags |= ZSHARD_NEED_SOFTINTR;			}			if (rr3 & ZSRR3_IP_B_STAT && (v = zssint(b, zc)) != 0) {				b->cs_rbuf[i++ & ringmask] = v;				intflags |= ZSHARD_NEED_SOFTINTR;			}			b->cs_rbput = i;		}		if (intflags & ZSHARD_CHIP_GOTINTR) {			a->cs_sc->sc_intrcnt.ev_count++;			intflags &= ~ZSHARD_CHIP_GOTINTR;		}	}#undef b	if (intflags & ZSHARD_NEED_SOFTINTR) {		if (CPU_ISSUN4COR4M) {			/* XXX -- but this will go away when zshard moves to locore.s */			struct clockframe *p = intrarg;			if ((p->psr & PSR_PIL) < (PIL_TTY << 8)) {				zsshortcuts++;				(void) spltty();				if (zshardscope) {					LED_ON;					LED_OFF;				}				return (zssoft(intrarg));			}		}#if defined(SUN4M)		if (CPU_ISSUN4M)			raise(0, PIL_TTY);		else#endif		ienab_bis(IE_ZSSOFT);	}	return (intflags & ZSHARD_WAS_SERVICED);}