DMA_RELSE(K) UNIX System V DMA_RELSE(K)
Name
dma_relse - releases previously allocated DMA channel
Syntax
#include "sys/dma.h"
int
dma_relse(chan)
unsigned chan;
Description
The dma_relse routine releases a DMA channel previously
allocated with dma_alloc(K) or dma_start(K). This routine
should be called during the interrupt signaling completion
of the DMA transfer or as soon as completion is detected (if
polling is being used). This routine has no return value.
If you intend to share DMA channels, you should use this
routine. Sharing DMA channels is highly recommended.
If no dmareq structures are in the pending-request queue,
dma_relse releases the channel, wakes up any processes
sleeping on the channel, and exits. Otherwise it performs
the next request on the queue by calling the xxd_proc
routine with a pointer to the dmareq structure as a
parameter. Because xxd_proc may be called during another
driver's interrupt, the xxd_proc routine should be as
minimal as possible to accomplish its task.
Parameters
The argument chan is the DMA channel to be released.
Possible values are:
8-Bit Channels: DMA_CH0, DMA_CH1, DMA_CH2, DMA_CH3
16-Bit Channels: DMA_CH5, DMA_CH6, DMA_CH7
Channel 4 is not available. Other channels may be
permanently allocated by system drivers. Consult the
/usr/adm/messages file for which channels are in use. Use
printcfg in your driver initialization routine to display
the DMA channel that you select.
Example
To release the channel that was allocated in the previous
allocation examples:
/* finished with DMA for now, release channel */
dma_relse( DMA_CH1 );
See Also
dma_enable(K), dma_start(K), dma_param(K), dma_alloc(K),
dma_resid(K), printcfg(K)
(printed 7/6/89)