diff options
author | jhb <jhb@FreeBSD.org> | 2005-09-27 17:39:11 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-09-27 17:39:11 +0000 |
commit | 89caa56972d968272278a67fe10affb38d9e88eb (patch) | |
tree | 368df1c62ea6aa397797927efbf9c7ccc4b3b92e /sys/sparc64 | |
parent | aa790ae8700e7fed7ef83f2549c6bc53d6ae7f8f (diff) | |
download | FreeBSD-src-89caa56972d968272278a67fe10affb38d9e88eb.zip FreeBSD-src-89caa56972d968272278a67fe10affb38d9e88eb.tar.gz |
Add a new atomic_fetchadd() primitive that atomically adds a value to a
variable and returns the previous value of the variable.
Tested on: i386, alpha, sparc64, arm (cognet)
Reviewed by: arch@
Submitted by: cognet (arm)
MFC after: 1 week
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/atomic.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/sparc64/include/atomic.h b/sys/sparc64/include/atomic.h index ed16955..77d455b 100644 --- a/sys/sparc64/include/atomic.h +++ b/sys/sparc64/include/atomic.h @@ -277,6 +277,9 @@ ATOMIC_GEN(64, uint64_t *, uint64_t, uint64_t, 64); ATOMIC_GEN(ptr, uintptr_t *, uintptr_t, uintptr_t, 64); +#define atomic_fetchadd_int atomic_add_int +#define atomic_fetchadd_32 atomic_add_32 + #undef ATOMIC_GEN #undef atomic_cas #undef atomic_cas_acq |