When arm 64-bit atomic ops are available, define ARM_HAVE_ATOMIC64. Use
that symbol (which will be correct in both kernel and userland contexts) rather than just __arm__ to decide whether to use a local implementation.
This commit is contained in:
parent
f10405b396
commit
c311f7078c
@ -88,6 +88,8 @@
|
||||
defined (__ARM_ARCH_6T2__) || \
|
||||
defined (__ARM_ARCH_6Z__) || \
|
||||
defined (__ARM_ARCH_6ZK__)
|
||||
#define ARM_HAVE_ATOMIC64
|
||||
|
||||
static __inline void
|
||||
__do_dmb(void)
|
||||
{
|
||||
@ -722,6 +724,8 @@ __swp(uint32_t val, volatile uint32_t *ptr)
|
||||
|
||||
|
||||
#ifdef _KERNEL
|
||||
#define ARM_HAVE_ATOMIC64
|
||||
|
||||
static __inline void
|
||||
atomic_set_32(volatile uint32_t *address, uint32_t setmask)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ atomic_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(__LP64__) && !defined(__mips_n32)
|
||||
#if !defined(__LP64__) && !defined(__mips_n32) && !defined(ARM_HAVE_ATOMIC64)
|
||||
void
|
||||
atomic_add_64(volatile uint64_t *target, int64_t delta)
|
||||
{
|
||||
|
@ -36,7 +36,7 @@
|
||||
atomic_cmpset_ptr((volatile uintptr_t *)(_a), (uintptr_t)(_b), (uintptr_t) (_c))
|
||||
#define cas32 atomic_cmpset_32
|
||||
|
||||
#if !defined(__LP64__) && !defined(__mips_n32) && !defined(__arm__)
|
||||
#if !defined(__LP64__) && !defined(__mips_n32) && !defined(ARM_HAVE_ATOMIC64)
|
||||
extern void atomic_add_64(volatile uint64_t *target, int64_t delta);
|
||||
extern void atomic_dec_64(volatile uint64_t *target);
|
||||
#endif
|
||||
@ -85,7 +85,7 @@ atomic_dec_32_nv(volatile uint32_t *target)
|
||||
return (atomic_fetchadd_32(target, -1) - 1);
|
||||
}
|
||||
|
||||
#if defined(__LP64__) || defined(__mips_n32) || defined(__arm__)
|
||||
#if defined(__LP64__) || defined(__mips_n32) || defined(ARM_HAVE_ATOMIC64)
|
||||
static __inline void
|
||||
atomic_dec_64(volatile uint64_t *target)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user