ATOMIC_INT_ALLOC(D3) ATOMIC_INT_ALLOC(D3)
NAME
ATOMIC_INT_ALLOC - allocate an ATOMIC_INT structure
SYNOPSIS
#include <sys/types.h>
#include <sys/kmem.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
atomic_int_t *ATOMIC_INT_ALLOC(int flag);
Arguments
flag Specifies whether the caller is willing to sleep
waiting for memory.
DESCRIPTION
ATOMIC_INT_ALLOC allocates an atomic_int_t object. If flag is
set to KM_SLEEP, the caller will sleep if necessary until the
required memory is available. If flag is set to KM_NOSLEEP,
the caller will not sleep, but ATOMIC_INT_ALLOC will return
NULL if the memory is not immediately available.
Return Values
Upon successful completion, ATOMIC_INT_ALLOC returns a pointer
to the newly allocated ATOMIC_INT object. If KM_NOSLEEP is
specified and sufficient memory is not immediately available,
ATOMIC_INT_ALLOC returns a NULL pointer.
USAGE
The ATOMIC_INT(D4) object returned must be initialized by
ATOMIC_INT_INIT(D3) before it is used.
Level
Base only if flag is set to KM_SLEEP.
Initialization, Base or Interrupt if flag is set to
KM_NOSLEEP.
Synchronization Constraints
May sleep if flag is set to KM_SLEEP.
Driver-defined basic locks and read/write locks may be held
across calls to this function if flag is KM_NOSLEEP, but may
not be held if flag is KM_SLEEP.
Copyright 1994 Novell, Inc. Page 1
ATOMIC_INT_ALLOC(D3) ATOMIC_INT_ALLOC(D3)
Driver-defined sleep locks may be held across calls to this
function regardless of the value of flag.
REFERENCES
ATOMIC_INT(D4), ATOMIC_INT_ADD(D3), ATOMIC_INT_DEALLOC(D3),
ATOMIC_INT_DECR(D3), ATOMIC_INT_INCR(D3), ATOMIC_INT_INIT(D3),
ATOMIC_INT_READ(D3), ATOMIC_INT_SUB(D3), ATOMIC_INT_WRITE(D3)
NOTICES
Portability
All processors
Applicability
ddi: 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2