aboutsummaryrefslogtreecommitdiff
path: root/sys/arm64/include
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2024-07-30 09:26:21 +0000
committerAndrew Turner <andrew@FreeBSD.org>2024-08-19 10:53:12 +0000
commit7a345763f96d86eee9ab578e64311bf452e58900 (patch)
treece7c4d629e93ede90508a446bc1b99324ce183fc /sys/arm64/include
parent87940d2b331c2575f96fbff2600d8da35191157b (diff)
downloadsrc-7a345763f96d86eee9ab578e64311bf452e58900.tar.gz
src-7a345763f96d86eee9ab578e64311bf452e58900.zip
arm64: Expand the use of Armv8.1-A atomics
When targeting Armv8.1 we can assume FEAT_LSE is available and can use the atomic instructions this provides without needing to check for support first. Reviewed by: imp, markj, emaste Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D46159
Diffstat (limited to 'sys/arm64/include')
-rw-r--r--sys/arm64/include/atomic.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arm64/include/atomic.h b/sys/arm64/include/atomic.h
index 76ca951678d4..c7aaa76d9de9 100644
--- a/sys/arm64/include/atomic.h
+++ b/sys/arm64/include/atomic.h
@@ -65,8 +65,9 @@ extern _Bool lse_supported;
#include <sys/atomic_common.h>
-#ifdef _KERNEL
-
+#if defined(__ARM_FEATURE_ATOMICS)
+#define _ATOMIC_LSE_SUPPORTED 1
+#elif defined(_KERNEL)
#ifdef LSE_ATOMICS
#define _ATOMIC_LSE_SUPPORTED 1
#else