Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/atomic.h
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
#define _ATOMIC_CMPSET(bar, a, l) \ | #define _ATOMIC_CMPSET(bar, a, l) \ | ||||
_ATOMIC_CMPSET_IMPL(8, w, b, bar, a, l) \ | _ATOMIC_CMPSET_IMPL(8, w, b, bar, a, l) \ | ||||
_ATOMIC_CMPSET_IMPL(16, w, h, bar, a, l) \ | _ATOMIC_CMPSET_IMPL(16, w, h, bar, a, l) \ | ||||
_ATOMIC_CMPSET_IMPL(32, w, , bar, a, l) \ | _ATOMIC_CMPSET_IMPL(32, w, , bar, a, l) \ | ||||
_ATOMIC_CMPSET_IMPL(64, , , bar, a, l) | _ATOMIC_CMPSET_IMPL(64, , , bar, a, l) | ||||
#define atomic_cmpset_8 atomic_cmpset_8 | |||||
#define atomic_fcmpset_8 atomic_fcmpset_8 | |||||
#define atomic_cmpset_16 atomic_cmpset_16 | |||||
#define atomic_fcmpset_16 atomic_fcmpset_16 | |||||
_ATOMIC_CMPSET( , , ) | _ATOMIC_CMPSET( , , ) | ||||
_ATOMIC_CMPSET(acq_, a, ) | _ATOMIC_CMPSET(acq_, a, ) | ||||
_ATOMIC_CMPSET(rel_, ,l) | _ATOMIC_CMPSET(rel_, ,l) | ||||
#define _ATOMIC_FETCHADD_PROTO(t, flav) \ | #define _ATOMIC_FETCHADD_PROTO(t, flav) \ | ||||
static __inline uint##t##_t \ | static __inline uint##t##_t \ | ||||
atomic_fetchadd_##t##flav(volatile uint##t##_t *p, uint##t##_t val) | atomic_fetchadd_##t##flav(volatile uint##t##_t *p, uint##t##_t val) | ||||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | __asm __volatile( \ | ||||
"ldar"#s" %"#w"0, [%1]\n" \ | "ldar"#s" %"#w"0, [%1]\n" \ | ||||
: "=&r" (ret) \ | : "=&r" (ret) \ | ||||
: "r" (p) \ | : "r" (p) \ | ||||
: "memory"); \ | : "memory"); \ | ||||
\ | \ | ||||
return (ret); \ | return (ret); \ | ||||
} | } | ||||
#define atomic_load_acq_8 atomic_load_acq_8 | |||||
#define atomic_load_acq_16 atomic_load_acq_16 | |||||
_ATOMIC_LOAD_ACQ_IMPL(8, w, b) | _ATOMIC_LOAD_ACQ_IMPL(8, w, b) | ||||
_ATOMIC_LOAD_ACQ_IMPL(16, w, h) | _ATOMIC_LOAD_ACQ_IMPL(16, w, h) | ||||
_ATOMIC_LOAD_ACQ_IMPL(32, w, ) | _ATOMIC_LOAD_ACQ_IMPL(32, w, ) | ||||
_ATOMIC_LOAD_ACQ_IMPL(64, , ) | _ATOMIC_LOAD_ACQ_IMPL(64, , ) | ||||
#define _ATOMIC_STORE_REL_IMPL(t, w, s) \ | #define _ATOMIC_STORE_REL_IMPL(t, w, s) \ | ||||
static __inline void \ | static __inline void \ | ||||
atomic_store_rel_##t(volatile uint##t##_t *p, uint##t##_t val) \ | atomic_store_rel_##t(volatile uint##t##_t *p, uint##t##_t val) \ | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
#define atomic_add_rel_ptr atomic_add_rel_64 | #define atomic_add_rel_ptr atomic_add_rel_64 | ||||
#define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_64 | #define atomic_fcmpset_rel_ptr atomic_fcmpset_rel_64 | ||||
#define atomic_clear_rel_ptr atomic_clear_rel_64 | #define atomic_clear_rel_ptr atomic_clear_rel_64 | ||||
#define atomic_cmpset_rel_ptr atomic_cmpset_rel_64 | #define atomic_cmpset_rel_ptr atomic_cmpset_rel_64 | ||||
#define atomic_set_rel_ptr atomic_set_rel_64 | #define atomic_set_rel_ptr atomic_set_rel_64 | ||||
#define atomic_subtract_rel_ptr atomic_subtract_rel_64 | #define atomic_subtract_rel_ptr atomic_subtract_rel_64 | ||||
#define atomic_store_rel_ptr atomic_store_rel_64 | #define atomic_store_rel_ptr atomic_store_rel_64 | ||||
static __inline void | static __inline void | ||||
andrew: Is this still needed after rS356550? | |||||
Done Inline ActionsNo, it isn’t. The patch hasn’t been rebased passed that revision yet. cem: No, it isn’t. The patch hasn’t been rebased passed that revision yet. | |||||
atomic_thread_fence_acq(void) | atomic_thread_fence_acq(void) | ||||
{ | { | ||||
dmb(ld); | dmb(ld); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
atomic_thread_fence_rel(void) | atomic_thread_fence_rel(void) | ||||
Show All 10 Lines | |||||
} | } | ||||
static __inline void | static __inline void | ||||
atomic_thread_fence_seq_cst(void) | atomic_thread_fence_seq_cst(void) | ||||
{ | { | ||||
dmb(sy); | dmb(sy); | ||||
} | } | ||||
#include <sys/_atomic_subword.h> | |||||
#endif /* KCSAN && !KCSAN_RUNTIME */ | #endif /* KCSAN && !KCSAN_RUNTIME */ | ||||
#endif /* _MACHINE_ATOMIC_H_ */ | #endif /* _MACHINE_ATOMIC_H_ */ |
Is this still needed after rS356550?