SCO OpenServer
dma_relse(D3oddi)
dma_relse --
release previously allocated DMA channel
Synopsis
#include <sys/dma.h>
void dma_relse(unsigned chan);
Description
The dma_relse function releases
a DMA channel that was previously allocated with
the
dma_alloc(D3oddi)
or
dma_start(D3oddi)
function.
Arguments
chan-
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 a list of channels that are in use.
Use the
printcfg(D3oddi)
function in your driver initialization routine to
display the DMA channel that you select.
Return values
None.
Usage
This function should be called during the interrupt signaling
completion of the DMA transfer or as
soon as completion is detected (if polling is being used).
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 routine defined in the
xxd_proc
member of the dmareq structure,
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.
Context and synchronization
Non-blockable, interrupt, user, or blockable
context.
Hardware applicability
All
Version applicability
oddi:
1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp
SVR5 DDI compatibility
This function is not supported for DDI drivers.
See
``DMA'' in HDK Technical Reference
for information about doing DMA operations
in DDI drivers.
References
dma_enable(D3oddi),
dma_start(D3oddi),
dma_param(D3oddi),
dma_alloc(D3oddi),
dma_resid(D3oddi),
printcfg(D3oddi)
Examples
The following example illustrates how to release a previously
allocated channel:
/* finished with DMA for now, release channel */
dma_relse( DMA_CH1 );
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005