Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 May 2015 08:57:24 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282763 - head/sys/arm/arm
Message-ID:  <201505110857.t4B8vOZr018937@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon May 11 08:57:23 2015
New Revision: 282763
URL: https://svnweb.freebsd.org/changeset/base/282763

Log:
  Move to use __ARM_ARCH in more places in the kernel.

Modified:
  head/sys/arm/arm/fusu.S
  head/sys/arm/arm/stdatomic.c

Modified: head/sys/arm/arm/fusu.S
==============================================================================
--- head/sys/arm/arm/fusu.S	Mon May 11 08:51:24 2015	(r282762)
+++ head/sys/arm/arm/fusu.S	Mon May 11 08:57:23 2015	(r282763)
@@ -33,6 +33,7 @@
  *
  */
 
+#include <machine/acle-compat.h>
 #include <machine/asm.h>
 #include <machine/armreg.h>
 #include "assym.s"
@@ -40,7 +41,7 @@ __FBSDID("$FreeBSD$");
 
 	.syntax	unified
 
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
 #define GET_PCB(tmp) \
 	mrc p15, 0, tmp, c13, c0, 4; \
 	add	tmp, tmp, #(TD_PCB)
@@ -68,7 +69,7 @@ EENTRY_NP(casuword32)
 	stmfd	sp!, {r4, r5}
 	adr	r4, .Lcasuwordfault
 	str	r4, [r3, #PCB_ONFAULT]
-#ifdef _ARM_ARCH_6
+#if __ARM_ARCH >= 6
 1:    
 	cmp     r0, #KERNBASE
 	mvnhs   r0, #0

Modified: head/sys/arm/arm/stdatomic.c
==============================================================================
--- head/sys/arm/arm/stdatomic.c	Mon May 11 08:51:24 2015	(r282762)
+++ head/sys/arm/arm/stdatomic.c	Mon May 11 08:57:23 2015	(r282763)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/stdatomic.h>
 #include <sys/types.h>
 
+#include <machine/acle-compat.h>
 #include <machine/cpufunc.h>
 #include <machine/sysarch.h>
 
@@ -66,16 +67,14 @@ do_sync(void)
 
 	__asm volatile ("" : : : "memory");
 }
-#elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
+#elif __ARM_ARCH >= 7
 static inline void
 do_sync(void)
 {
 
 	__asm volatile ("dmb" : : : "memory");
 }
-#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
-    defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
-    defined(__ARM_ARCH_6ZK__)
+#elif __ARM_ARCH >= 6
 static inline void
 do_sync(void)
 {
@@ -90,14 +89,8 @@ do_sync(void)
  * New C11 __atomic_* API.
  */
 
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
-    defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
-    defined(__ARM_ARCH_6ZK__) || \
-    defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
-
-/* These systems should be supported by the compiler. */
-
-#else /* __ARM_ARCH_5__ */
+/* ARMv6+ systems should be supported by the compiler. */
+#if __ARM_ARCH <= 5
 
 /* Clang doesn't allow us to reimplement builtins without this. */
 #ifdef __clang__
@@ -331,7 +324,7 @@ EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str"
 
 #endif /* _KERNEL */
 
-#endif
+#endif /* __ARM_ARCH */
 
 #endif /* __CLANG_ATOMICS || __GNUC_ATOMICS */
 
@@ -365,10 +358,7 @@ EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str"
  * Old __sync_* API.
  */
 
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
-    defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
-    defined(__ARM_ARCH_6ZK__) || \
-    defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__)
+#if __ARM_ARCH >= 6
 
 /* Implementations for old GCC versions, lacking support for atomics. */
 
@@ -686,7 +676,7 @@ __strong_reference(__sync_fetch_and_xor_
 __strong_reference(__sync_fetch_and_xor_4_c, __sync_fetch_and_xor_4);
 #endif
 
-#else /* __ARM_ARCH_5__ */
+#else /* __ARM_ARCH < 6 */
 
 #ifdef _KERNEL
 
@@ -881,7 +871,7 @@ __strong_reference(__sync_fetch_and_or_4
 __strong_reference(__sync_fetch_and_xor_1_c, __sync_fetch_and_xor_1);
 __strong_reference(__sync_fetch_and_xor_2_c, __sync_fetch_and_xor_2);
 __strong_reference(__sync_fetch_and_xor_4_c, __sync_fetch_and_xor_4);
-#endif
+#endif /* __ARM_ARCH */
 
 #endif /* _KERNEL */
 



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