diff options
author | Richard Braun <rbraun@sceen.net> | 2018-04-18 21:45:12 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-04-19 01:45:43 +0200 |
commit | 8790d75d93c7e06b7b93c1078260aaf1e4ea25ca (patch) | |
tree | 478eb3eb2607f1312d7b4e64cab23f3bcb0268ee /kern/atomic.h | |
parent | 3640f94ee392b19de48360d2d026a7f581447049 (diff) |
kern/atomic: remove shortcuts
These shortcuts just don't bring enough value.
Diffstat (limited to 'kern/atomic.h')
-rw-r--r-- | kern/atomic.h | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/kern/atomic.h b/kern/atomic.h index 5d99da90..d37a28bf 100644 --- a/kern/atomic.h +++ b/kern/atomic.h @@ -104,36 +104,6 @@ MACRO_END #define atomic_store(ptr, val, mo) __atomic_store_n(ptr, val, mo) #endif -/* - * Thread fences. - */ - -#define atomic_fence_acquire() __atomic_thread_fence(ATOMIC_ACQUIRE) -#define atomic_fence_release() __atomic_thread_fence(ATOMIC_RELEASE) -#define atomic_fence_acq_rel() __atomic_thread_fence(ATOMIC_ACQ_REL) -#define atomic_fence_seq_cst() __atomic_thread_fence(ATOMIC_SEQ_CST) - -/* - * Common shortcuts. - */ - -#define atomic_load_acquire(ptr) atomic_load(ptr, ATOMIC_ACQUIRE) -#define atomic_store_release(ptr, val) atomic_store(ptr, val, ATOMIC_RELEASE) - -#define atomic_cas_acquire(ptr, oval, nval) \ - atomic_cas(ptr, oval, nval, ATOMIC_ACQUIRE) - -#define atomic_cas_release(ptr, oval, nval) \ - atomic_cas(ptr, oval, nval, ATOMIC_RELEASE) - -#define atomic_cas_acq_rel(ptr, oval, nval) \ - atomic_cas(ptr, oval, nval, ATOMIC_ACQ_REL) - -#define atomic_swap_acquire(ptr, val) atomic_swap(ptr, val, ATOMIC_ACQUIRE) -#define atomic_swap_release(ptr, val) atomic_swap(ptr, val, ATOMIC_RELEASE) -#define atomic_swap_acq_rel(ptr, val) atomic_swap(ptr, val, ATOMIC_ACQ_REL) - -#define atomic_fetch_sub_acq_rel(ptr, val) \ - atomic_fetch_sub(ptr, val, ATOMIC_ACQ_REL) +#define atomic_fence(mo) __atomic_thread_fence(mo) #endif /* KERN_ATOMIC_H */ |