ATOMIC_SWAP_UINT(9) BSD Kernel Developer's Manual ATOMIC_SWAP_UINT(9)
atomic_swap_uint, atomic_swap_ulong, atomic_swap_ptr -- atomic swap oper-
atomic_swap_uint(volatile unsigned int *p, unsigned int new);
atomic_swap_ulong(volatile unsigned long *p, unsigned long new);
atomic_swap_ptr(volatile void *p, void *new);
The atomic_swap set of functions provide an interface for atomically per-
forming swap operations with respect to interrupts and multiple proces-
sors in the system.
The value referenced by the pointer p is replaced by the value new.
atomic_swap_uint(), atomic_swap_ulong(), and atomic_swap_ptr() can all be
called during autoconf, from process context, or from interrupt context.
These functions return the value at p as it was before the swap opera-
The atomic_swap functions first appeared in NetBSD 5.0 and OpenBSD 5.5.
BSD July 18, 2014 BSD