Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 2014 03:44:28 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269414 - in head/sys: arm/include cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys
Message-ID:  <201408020344.s723iSVM096645@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408020344.s723iSVM096645>