svn commit: r269414 - in head/sys: arm/include cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys
Ian Lepore
ian at FreeBSD.org
Sat Aug 2 03:44:28 UTC 2014
Author: ian
Date: Sat Aug 2 03:44:27 2014
New Revision: 269414
URL: http://svnweb.freebsd.org/changeset/base/269414
Log:
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.
Modified:
head/sys/arm/include/atomic.h
head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c
head/sys/cddl/compat/opensolaris/sys/atomic.h
Modified: head/sys/arm/include/atomic.h
==============================================================================
--- head/sys/arm/include/atomic.h Sat Aug 2 01:48:25 2014 (r269413)
+++ head/sys/arm/include/atomic.h Sat Aug 2 03:44:27 2014 (r269414)
@@ -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 *p
#ifdef _KERNEL
+#define ARM_HAVE_ATOMIC64
+
static __inline void
atomic_set_32(volatile uint32_t *address, uint32_t setmask)
{
Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Sat Aug 2 01:48:25 2014 (r269413)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Sat Aug 2 03:44:27 2014 (r269414)
@@ -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)
{
Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/atomic.h Sat Aug 2 01:48:25 2014 (r269413)
+++ head/sys/cddl/compat/opensolaris/sys/atomic.h Sat Aug 2 03:44:27 2014 (r269414)
@@ -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 *targ
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)
{
More information about the svn-src-all
mailing list