Kernel Functions for Drivers ddiiopballoc(9F)
NAME
ddiiopballoc, ddiiopbfree - allocate and free non-
sequentially accessed memory
SYNOPSIS
#include
#include
int ddiiopballoc(devinfot *dip, ddidmalimt *limits,
uintt length, caddrt *iopbp);
void ddiiopbfree(caddrt iopb);
INTERFACE LEVEL
These interfaces are obsolete. Use ddidmamemalloc(9F)
instead of ddiiopballoc(). Use ddidmamemfree(9F)
instead of ddiiopbfree().
PARAMETERS
ddiiopballoc()
dip A pointer to the device's devinfo structure.
limits A pointer to a DMA limits structure for this dev-
ice (see ddidmalimsparc(9S) or
ddidmalimx86(9S)). If this pointer is NUL, a
default set of DMA limits is assumed.
length The length in bytes of the desired allocation.
iopbp A pointer to a caddrt. On a successful return,
*iopbp points to the allocated storage.
ddiiopbfree()
iopb The iopb returned from a successful call to
ddiiopballoc().
DESCRIPTION
The ddiiopballoc() function allocates memory for DMA
transfers and should be used if the device accesses memory
in a non-sequential fashion, or if synchronization steps
using ddidmasync(9F) should be as lightweight as possible,
due to frequent use on small objects. This type of access is
commonly known as consistent access. The allocation will
obey the alignment and padding constraints as specified in
the limits argument and other limits imposed by the system.
SunOS 5.11 Last change: 04 Apr 2006 1
Kernel Functions for Drivers ddiiopballoc(9F)
Note that you still must use DMA resource allocation func-
tions (see ddidmasetup(9F)) to establish DMA resources for
the memory allocated using ddiiopballoc().
In order to make the view of a memory object shared between
a CPU and a DMA device consistent, explicit synchronization
steps using ddidmasync(9F) or ddidmafree(9F) are still
required. The DMA resources will be allocated so that these
synchronization steps are as efficient as possible.
The ddiiopbfree() function frees up memory allocated by
ddiiopballoc().
RETURN VALUES
The ddiiopballoc() function returns:
DISUCES Memory successfully allocated.
DIFAILURE Allocation failed.
CONTEXT
These functions can be called from user, interrupt, or ker-
nel context.
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Stability Level Obsolete
SEE ALSO
attributes(5), ddidmafree(9F), ddidmamemalloc(9F),
ddidmamemfree(9F), ddidmasetup(9F), ddidmasync(9F),
ddimemalloc(9F), ddidmalimsparc(9S),
ddidmalimx86(9S), ddidmareq(9S)
Writing Device Drivers
NOTES
SunOS 5.11 Last change: 04 Apr 2006 2
Kernel Functions for Drivers ddiiopballoc(9F)
This function uses scarce system resources. Use it selec-
tively.
SunOS 5.11 Last change: 04 Apr 2006 3
|