ATOMIC_INT_READ(D3) ATOMIC_INT_READ(D3)
NAME
ATOMIC_INT_READ - read the value stored within an ATOMIC_INT
SYNOPSIS
#include <sys/types.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
int ATOMIC_INT_READ(atomic_int_t *counter);
Arguments
counter Points to an ATOMIC_INT object from which the
integer value is to be obtained.
DESCRIPTION
ATOMIC_INT_READ returns the integer value contained within the
object referenced by counter.
Return Values
The integer value contained within the object referenced by
counter.
USAGE
The ATOMIC_INT(D4) object pointed to by counter must have been
previously allocated by ATOMIC_INT_ALLOC(D3) and initialized
by ATOMIC_INT_INIT(D3).
Warnings
The atomicity properties of ATOMIC_INT objects (as defined in
the Synchronization Constraints section below) are strictly
limited to a single object. Drivers should be careful not to
assume any ordering of operations between two instances of
ATOMIC_INT objects, or between these objects and objects whose
access patterns are serialized by means of locks, unless such
ordering is explicitly arranged for in the driver through use
of locks. In particular, drivers should not assume that
arbitrary writes will be observed in any particular order by
another engine.
Level
Initialization, Base or Interrupt.
Synchronization Constraints
For any single ATOMIC_INT object, the following operations on
that object are serialized: ATOMIC_INT_ADD(D3),
ATOMIC_INT_DECR(D3), ATOMIC_INT_INCR(D3), ATOMIC_INT_READ(D3),
ATOMIC_INT_SUB(D3), and ATOMIC_INT_WRITE(D3). This means that
Copyright 1994 Novell, Inc. Page 1
ATOMIC_INT_READ(D3) ATOMIC_INT_READ(D3)
the results of a set of these operations on multiple engines
will appear as though they had occurred in some specific order
on a single engine.
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function.
REFERENCES
ATOMIC_INT(D4), ATOMIC_INT_ADD(D3), ATOMIC_INT_ALLOC(D3),
ATOMIC_INT_DEALLOC(D3), ATOMIC_INT_DECR(D3),
ATOMIC_INT_INCR(D3), ATOMIC_INT_INIT(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