This provides for atomic addition, which will be used by an upcoming shader-cache patch. A simple test is added to "make check" as well.
Note: The various O/S functions differ on whether they return the original value or the value after the addition, so I did not provide an add_return() macro which would be sensitive to that difference.
b16de0b util/u_atomic: Add new macro p_atomic_add
src/util/u_atomic.h | 16 ++++++++++++++++
src/util/u_atomic_test.c | 5 +++++
2 files changed, 21 insertions(+)
Upstream: cgit.freedesktop.org