Changeset View
Changeset View
Standalone View
Standalone View
sys/arm64/include/atomic.h
Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | atomic_fcmpset_##bar##64(volatile uint64_t *p, uint64_t *cmpval, \ | ||||
*cmpval = tmp; \ | *cmpval = tmp; \ | ||||
\ | \ | ||||
return (!res); \ | return (!res); \ | ||||
} | } | ||||
ATOMIC_FCMPSET( , , ) | ATOMIC_FCMPSET( , , ) | ||||
ATOMIC_FCMPSET(acq_, a, ) | ATOMIC_FCMPSET(acq_, a, ) | ||||
ATOMIC_FCMPSET(rel_, ,l) | ATOMIC_FCMPSET(rel_, ,l) | ||||
#define atomic_fcmpset_8 atomic_fcmpset_8 | |||||
#define atomic_fcmpset_16 atomic_fcmpset_16 | |||||
#undef ATOMIC_FCMPSET | #undef ATOMIC_FCMPSET | ||||
#define ATOMIC_CMPSET(bar, a, l) \ | #define ATOMIC_CMPSET(bar, a, l) \ | ||||
static __inline int \ | static __inline int \ | ||||
atomic_cmpset_##bar##8(volatile uint8_t *p, uint8_t cmpval, \ | atomic_cmpset_##bar##8(volatile uint8_t *p, uint8_t cmpval, \ | ||||
uint8_t newval) \ | uint8_t newval) \ | ||||
{ \ | { \ | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | atomic_cmpset_##bar##64(volatile uint64_t *p, uint64_t cmpval, \ | ||||
); \ | ); \ | ||||
\ | \ | ||||
return (!res); \ | return (!res); \ | ||||
} | } | ||||
ATOMIC_CMPSET( , , ) | ATOMIC_CMPSET( , , ) | ||||
ATOMIC_CMPSET(acq_, a, ) | ATOMIC_CMPSET(acq_, a, ) | ||||
ATOMIC_CMPSET(rel_, ,l) | ATOMIC_CMPSET(rel_, ,l) | ||||
#define atomic_cmpset_8 atomic_cmpset_8 | |||||
#define atomic_cmpset_16 atomic_cmpset_16 | |||||
static __inline uint32_t | static __inline uint32_t | ||||
atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) | atomic_fetchadd_32(volatile uint32_t *p, uint32_t val) | ||||
{ | { | ||||
uint32_t tmp, ret; | uint32_t tmp, ret; | ||||
int res; | int res; | ||||
__asm __volatile( | __asm __volatile( | ||||
▲ Show 20 Lines • Show All 223 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 | ||||
#include <sys/_atomic_subword.h> | |||||
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. | |||||
static __inline void | static __inline void | ||||
atomic_thread_fence_acq(void) | atomic_thread_fence_acq(void) | ||||
{ | { | ||||
dmb(ld); | dmb(ld); | ||||
} | } | ||||
Show All 25 Lines |
Is this still needed after rS356550?