iomem_alloc(D3DK) —
.IX \f4iomem_alloc\fP(D3DK)
NAME
iomem_alloc − allocate physically contiguous memory
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
#include <sys/iosystm.h>
caddr_t iomem_alloc(int nbytes, int flags);
ARGUMENTS
nbytessize, in bytes, of the request
flagsspecial processing request
DESCRIPTION
The memory returned is physically contiguous and virtually mapped (no guarantee of 1:1 mapping).
iomem_alloc accepts the flags IOM_NOSLEEP, IOM_NOCACHE, and IOM_COHERENT. The IOM_NOSLEEP flag should be set if the requester will tolerate waiting for the request memory. The IOM_NOCACHE flag should be set if the requested pages should be marked as cache-inhibited after they have been successfully allocated. If IOM_COHERENT flag is set, iomem_alloc allocates the requested memory as cache-inhibited only if the CPU that the system is running on requires it. Unless there is a specific need for cache-inhibited memory, this flag is the preferred use. If the IOM_NOCACHE and the IOM_COHERENT flags are both set, the IOM_COHERENT flag is ignored. Because iomem_alloc fails (returning NULL) when the requested number of contiguous pages cannot be found, it should be called at system initialization only.
NOTES
Memory allocated by iomem_alloc is not paged. Available memory is therefore limited. Excessive use of this memory is likely to affect overall system performance.
RETURN VALUES
If successful, iomem_alloc returns the address of the first byte of the contiguous memory allocated. On UNIX System V/88, NULL is returned if IOM_NOSLEEP is set and memory cannot be allocated.
LEVEL
Base
SEE ALSO
iomem_free(D3DK), kmem_alloc(D3DK)
DDI/DKI