DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_kmem_alloc_phys(D3sdi)


sdi_kmem_alloc_phys -- allocate DMA addressable, driver accessible memory

Synopsis

   #include <sys/kmem.h>
   #include <sys/sdi.h>
   #include <sys/ddi.h>
   

void * sdi_kmem_alloc_phys(size_t size, const physreq_t *preqp, int flags);

Description

The sdi_kmem_alloc_phys( ) function allocates size bytes of physically-contiguous memory with the physical addresss alignment properties specified by preqp, and returns the base physcial address of this memory in extra bytes at the end of the allocated memory. The memory returned by sdi_kmem_alloc_phys( ) is physically contiguous even if the PREQ_PHYSCONTIG bit in the physreq(D4) structure is not set.

Arguments


size
Number of bytes to allocate. The physical address is returned at the end of the allocated memory (size bytes from the beginning of the returned memory).

preqp
Pointer to a physreq(D4) structure. preqp->phys_dmasize must not be zero.

flags
Valid values are:

0
Allocation can block to wait for resources.

KM_FAIL_OK
Return NULL if memory is not readily available, although the allocation may still block for a limited amount of time.

Return values

On success, sdi_kmem_alloc_phys( ) returns a pointer to the allocated memory. The base physical address (from the driver's point of view) is stored at the end of this physical memory.

If flags is set to KM_FAIL_OK and memory is not available for the allocation, sdi_kmem_alloc_phys( ) returns NULL and does not allocate the memory.

Usage

Context and synchronization

Blockable context.

Hardware applicability

All

Version applicability

sdi: 4 target drivers

References

kmem_alloc_phys(D3), physreq(D4)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005