FreeBSD/sys/x86/isa/isa_dma.c
/*
 * Stop a DMA transfer currently in progress.
 */
Stop a DMA transfer currently in progress.
Stop a DMA transfer currently in progress .
int
isa_dmastop(int chan) 
{
	int status;
	mtx_lock(&isa_dma_lock);
	if ((dma_inuse & (1 << chan)) == 0)
		printf("isa_dmastop: channel %d not acquired\n", chan);  
	if (((dma_busy & (1 << chan)) == 0) &&
	    ((dma_auto_mode & (1 << chan)) == 0)) {
		printf("chan %d not busy\n", chan);
		mtx_unlock(&isa_dma_lock);
		return -2 ;
	}
	if ((chan & 4) == 0) {
		outb(DMA1_SMSK, (chan & 3) | 4 );
	} else {
		outb(DMA2_SMSK, (chan & 3) | 4 );
	}
	status = isa_dmastatus_locked(chan);
	mtx_unlock(&isa_dma_lock);
	return (status);
}
int isa_dmastop ( int chan ) { int status ; mtx_lock ( & isa_dma_lock ) ; if ( ( dma_inuse & ( 1 << chan ) ) == 0 ) printf ( " \n " , chan ) ; if ( ( ( dma_busy & ( 1 << chan ) ) == 0 ) && ( ( dma_auto_mode & ( 1 << chan ) ) == 0 ) ) { printf ( " \n " , chan ) ; mtx_unlock ( & isa_dma_lock ) ; return -2 ; } if ( ( chan & 4 ) == 0 ) { outb ( DMA1_SMSK , ( chan & 3 ) | 4 ) ; } else { outb ( DMA2_SMSK , ( chan & 3 ) | 4 ) ; } status = isa_dmastatus_locked ( chan ) ; mtx_unlock ( & isa_dma_lock ) ; return ( status ) ; }
Stop a DMA transfer currently in progress.
Stop a DMA transfer currently in progress .
/* disable mask */ /* disable mask */