allocate and clear memory with specified physical properties
void *kmem_zalloc_physreq(size_t size, physreq_t *preqp, int flag)
kmem_zalloc_physreq allocates size bytes of memory with the
physical address alignment and contiguity properties specified by preqp,
and then clear the memory by filling it with zeros.
If flag is set to KM_SLEEP, the caller will sleep,
if necessary, until the memory with the specified properties is available.
If flag is set to KM_NOSLEEP, the caller will not sleep,
but kmem_zalloc_physreq will return NULL
if suitable memory is not immediately available.
Number of bytes to allocate.
Pointer to a
Specifies whether the caller is willing to sleep waiting for memory.
Upon successful completion, kmem_zalloc_physreq
returns a pointer to the allocated memory.
If size is set to 0, kmem_zalloc_physreq returns NULL
regardless of the value of flag.
The preqp argument points to a physreq structure,
previously allocated by
This structure is used to define physical address alignment
Drivers should call kmem_zalloc_physreq as early as possible if
contiguous memory larger than one page is being requested, preferably
during driver initialization. Due to randomization of the free page list,
physically contiguous pages might not be available after the system has run
at load for some time. This could cause kmem_zalloc_physreq to either
fail (in the KM_NOSLEEP case) or possibly wait forever (in the
This routine should not be called
during I/O transfers
when contiguous memory larger than one page
is being requested.
Context and synchronization
If flag is set to KM_NOSLEEP,
non-blockable, initialization, or interrupt
If flag is set to KM_SLEEP,
6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005