|| !pdma_5380_dir)
|| !pdma_5380_dir) {
ncr5380_drq_intr(p)	void	*p;{#if USE_PDMAextern	int			*nofault, mac68k_buserr_addr;	struct ncr_softc	*sc = p;	label_t			faultbuf;	register int		count;	volatile u_int32_t	*long_drq;	u_int32_t		*long_data;	volatile u_int8_t	*drq;	u_int8_t		*data;	/*	 * If we're not ready to xfer data, just return.	 */	if (   !(GET_5380_REG(NCR5380_DMSTAT) & SC_DMA_REQ)	    || !pdma_5380_dir)		return;#if DEBUG	pdma_5380_state = "got drq interrupt.";#endif	/*	 * Setup for a possible bus error caused by SCSI controller	 * switching out of DATA-IN/OUT before we're done with the	 * current transfer.	 */	nofault = (int *) &faultbuf;	if (setjmp((label_t *) nofault)) {		nofault = (int *) 0;#if DEBUG		pdma_5380_state = "buserr in xfer.";#endif		count = (  (u_long) mac68k_buserr_addr			 - (u_long) ncr_5380_with_drq);		if ((count < 0) || (count > pending_5380_count)) {			printf("pdma %s: count = %d (0x%x) (pending "				"count %d)\n",				(pdma_5380_dir == 2) ? "in" : "out",				count, count, pending_5380_count);			panic("something is wrong");		}		pending_5380_data += count;		pending_5380_count -= count;#if DEBUG		pdma_5380_state = "handled bus error in xfer.";#endif		mac68k_buserr_addr = 0;		return;	}	if (pdma_5380_dir == 2) { /* Data In */		int	resid;		/*		 * Get the dest address aligned.		 */		resid = count = 4 - (((int) pending_5380_data) & 0x3);		if (count < 4) {			data = (u_int8_t *) pending_5380_data;			drq = (u_int8_t *) ncr_5380_with_drq;			while (count) {#define R1	*data++ = *drq++				R1; count--;#undef R1			}			pending_5380_data += resid;			pending_5380_count -= resid;		}		/*		 * Get ready to start the transfer.		 */		while (pending_5380_count) {		int dcount;		dcount = count = min(pending_5380_count, MIN_PHYS);		long_drq = (volatile u_int32_t *) ncr_5380_with_drq;		long_data = (u_int32_t *) pending_5380_data;#define R4	*long_data++ = *long_drq++		while ( count >= 512 ) {			if (!(GET_5380_REG(NCR5380_DMSTAT) & SC_DMA_REQ)) {				nofault = (int *) 0;				pending_5380_data += (dcount - count);				pending_5380_count -= (dcount - count);#if DEBUG				pdma_5380_state = "drq low";#endif				return;			}			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;	/* 64 */			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;	/* 128 */			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;	/* 256 */			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;			R4; R4; R4; R4; R4; R4; R4; R4;	/* 512 */			count -= 512;		}		while (count >= 4) {			R4; count -= 4;		}#undef R4		data = (u_int8_t *) long_data;		drq = (u_int8_t *) long_drq;		while (count) {#define R1	*data++ = *drq++			R1; count--;#undef R1		}		pending_5380_count -= dcount;		pending_5380_data += dcount;		}	} else {		int	resid;		/*		 * Get the source address aligned.		 */		resid = count = 4 - (((int) pending_5380_data) & 0x3);		if (count < 4) {			data = (u_int8_t *) pending_5380_data;			drq = (u_int8_t *) ncr_5380_with_drq;			while (count) {#define W1	*drq++ = *data++				W1; count--;#undef W1			}			pending_5380_data += resid;			pending_5380_count -= resid;		}		/*		 * Get ready to start the transfer.		 */		while (pending_5380_count) {		int dcount;		dcount = count = min(pending_5380_count, MIN_PHYS);		long_drq = (volatile u_int32_t *) ncr_5380_with_drq;		long_data = (u_int32_t *) pending_5380_data;#define W4	*long_drq++ = *long_data++		while ( count >= 64 ) {			W4; W4; W4; W4; W4; W4; W4; W4;			W4; W4; W4; W4; W4; W4; W4; W4; /*  64 */			count -= 64;		}		while (count >= 4) {			W4; count -= 4;		}#undef W4		data = (u_int8_t *) long_data;		drq = (u_int8_t *) long_drq;		while (count) {#define W1	*drq++ = *data++			W1; count--;#undef W1		}		pending_5380_count -= dcount;		pending_5380_data += dcount;		}	}	/*	 * OK.  No bus error occurred above.  Clear the nofault flag	 * so we no longer short-circuit bus errors.	 */	nofault = (int *) 0;#if DEBUG	pdma_5380_state = "done in xfer--waiting.";#endif	/*	 * Is this necessary?	 */	while (!(   (GET_5380_REG(NCR5380_DMSTAT) & SC_ACK_STAT)		 || (GET_5380_REG(NCR5380_IDSTAT) &    SC_S_REQ) ));	/*	 * Update pointers for pdma_cleanup().	 */	pending_5380_data += pending_5380_count;	pending_5380_count = 0;#if DEBUG	pdma_5380_state = "done in xfer.";#endif	pdma_cleanup();	return;#endif	/* if USE_PDMA */}