git: 7a345763f96d - main - arm64: Expand the use of Armv8.1-A atomics

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 19 Aug 2024 11:03:34 UTC
The branch main has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a345763f96d86eee9ab578e64311bf452e58900

commit 7a345763f96d86eee9ab578e64311bf452e58900
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-07-30 09:26:21 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-08-19 10:53:12 +0000

    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
---
 sys/arm64/include/atomic.h | 5 +++--
 1 file 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