Overview ======== "User-Level Atomic Operations" (PSARC/2000/505) defines a collection of atomic instructions available to multithreaded userland applications. These functions have existed as part of the kernel for a similar period of time. The kernel versions have neither an ARC case nor a man page, and hence it's assumed they are consolidation private. The ability to do atomic instructions in the kernel is as useful to kernel software developers as the 'libc' versions are to user level application developers. There are some atomic operations in the kernel that are also useful but are not defined in 2000/505. These should also be considered for an Evolving classification. This case proposes to reclassify all the atomic operation functions in the of the publicly useful (see below) interfaces to "Evolving". It will also make sure that all the atomic functions defined in the kernel and being made public by this case are added to 'libc' such that what is available in the kernel is also available to the application layer. These extra user-land functions added by this project are: atomic_or_long, atomic_and_long, cas32, caslong, cas64, casptr, cas8, atomic_set_long_excl, and atomic_clear_long_excl. The requested release binding is "Minor". Details ======= Over the years the following functions have proved to be very useful to the NSPG consolidation to reduce cost of points of serialization in kernel device drivers. This case would like to make these interfaces publicly available, and assign a stability level of Evolving. Man pages for all of the interfaces being classified as Evolving are available in the case directory. Publicly Useful (classified as Evolving) ================= The following atomic operation functions can be used in device drivers to implement various synchronization mechanisms that cannot be easily implemented via semaphores, condition variables, mutexes or reader/writer locks. atomic_add_16 Atomically 'add' a 16 bit value. atomic_add_32 Atomically 'add' a 32 bit value. atomic_add_long Atomically 'add' a long bit value. atomic_add_64 Atomically 'add' a 64 bit value. atomic_or_uint Atomically 'or' a unsigned int value. atomic_or_32 Atomically 'or' a 32 bit value. atomic_or_long Atomically 'or' a long value. atomic_and_uint Atomically 'and' a unsigned int value. atomic_and_32 Atomically 'and' a 32 bit value. atomic_and_long Atomically 'and' a long value. atomic_add_16_nv Atomically 'add' a 16 bit value and return the result as a function result. atomic_add_32_nv Atomically 'add' a 32 bit value and return the result as a function result. atomic_add_long_nv Atomically 'add' a long value and return the result as a function result. atomic_add_64_nv Atomically 'add' a 64 bit value and return the result as a function result. cas32 Atomically compare a given 32 bit value with a comparative 32 bit value, if equal they are equal apply a new value, otherwise do nothing. Always return the old value. caslong Atomically compare a given long value with a comparative long value, if equal they are equal apply a new value, otherwise do nothing. Always return the old value. cas64 Atomically compare a given 64 bit value with a comparative 64 bit value, if equal they are equal apply a new value, otherwise do nothing. Always return the old value. casptr Atomically compare a given pointer value with a comparative pointer value, if equal they are equal apply a new value, otherwise do nothing. Always return the old value. cas8 Atomically compare a given 8 bit value with a comparative 8 bit value, if equal they are equal apply a new value, otherwise do nothing. Always return the old value. atomic_set_long_excl Perform an exclusive atomic bit set on a target. Returns 0 if bit was successfully set, or -1 if the bit was already set. atomic_clear_long_excl Perform an exclusive atomic bit clear on a target. Returns 0 if bit was successfully cleared, or -1 if the bit was already cleared.