printf("MARK: running %d: mode %d done %d errs %d errno 0x%x ttl %d buf %x\n",
printf("MARK: running %d: mode %d done %d errs %d errno 0x%x ttl %d buf %p\n",
xdc_tick(arg)	void   *arg;{	struct xdc_softc *xdcsc = arg;	int     lcv, s, reset = 0;#ifdef XDC_DIAG	int     wait, run, free, done, whd;	u_char  fqc[XDC_MAXIOPB], wqc[XDC_MAXIOPB], mark[XDC_MAXIOPB];	s = splbio();	wait = xdcsc->nwait;	run = xdcsc->nrun;	free = xdcsc->nfree;	done = xdcsc->ndone;	bcopy(xdcsc->waitq, wqc, sizeof(wqc));	bcopy(xdcsc->freereq, fqc, sizeof(fqc));	splx(s);	if (wait + run + free + done != XDC_MAXIOPB) {		printf("%s: diag: IOPB miscount (got w/f/r/d %d/%d/%d/%d, wanted %d)\n",		    xdcsc->sc_dev.dv_xname, wait, free, run, done, XDC_MAXIOPB);		bzero(mark, sizeof(mark));		printf("FREE: ");		for (lcv = free; lcv > 0; lcv--) {			printf("%d ", fqc[lcv - 1]);			mark[fqc[lcv - 1]] = 1;		}		printf("\nWAIT: ");		lcv = wait;		while (lcv > 0) {			printf("%d ", wqc[whd]);			mark[wqc[whd]] = 1;			whd = (whd + 1) % XDC_MAXIOPB;			lcv--;		}		printf("\n");		for (lcv = 0; lcv < XDC_MAXIOPB; lcv++) {			if (mark[lcv] == 0)				printf("MARK: running %d: mode %d done %d errs %d errno 0x%x ttl %d buf %x\n",				lcv, xdcsc->reqs[lcv].mode,				xdcsc->iopbase[lcv].done,				xdcsc->iopbase[lcv].errs,				xdcsc->iopbase[lcv].errno,				xdcsc->reqs[lcv].ttl, xdcsc->reqs[lcv].buf);		}	} else		if (done > XDC_MAXIOPB - XDC_SUBWAITLIM)			printf("%s: diag: lots of done jobs (%d)\n",				xdcsc->sc_dev.dv_xname, done);#endif#ifdef XDC_DEBUG	printf("%s: tick: csr 0x%x, w/f/r/d %d/%d/%d/%d\n",		xdcsc->sc_dev.dv_xname,		xdcsc->xdc->xdc_csr, xdcsc->nwait, xdcsc->nfree, xdcsc->nrun,		xdcsc->ndone);	for (lcv = 0; lcv < XDC_MAXIOPB; lcv++) {		if (xdcsc->reqs[lcv].mode)		  printf("running %d: mode %d done %d errs %d errno 0x%x\n",			 lcv,			 xdcsc->reqs[lcv].mode, xdcsc->iopbase[lcv].done,			 xdcsc->iopbase[lcv].errs, xdcsc->iopbase[lcv].errno);	}#endif	/* reduce ttl for each request if one goes to zero, reset xdc */	s = splbio();	for (lcv = 0; lcv < XDC_MAXIOPB; lcv++) {		if (xdcsc->reqs[lcv].mode == 0 ||		    XD_STATE(xdcsc->reqs[lcv].mode) == XD_SUB_DONE)			continue;		xdcsc->reqs[lcv].ttl--;		if (xdcsc->reqs[lcv].ttl == 0)			reset = 1;	}	if (reset) {		printf("%s: watchdog timeout\n", xdcsc->sc_dev.dv_xname);		xdc_reset(xdcsc, 0, XD_RSET_NONE, XD_ERR_FAIL, NULL);	}	splx(s);	/* until next time */	timeout(xdc_tick, xdcsc, XDC_TICKCNT);}