Date: Sun, 1 Dec 2024 04:57:23 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 994b7127f670 - stable/14 - arm: Implement atomic_testandset_acq_long as a simple wrapper Message-ID: <202412010457.4B14vN1C095811@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=994b7127f670db8ab0799e5954ea2f40042c1c3a commit 994b7127f670db8ab0799e5954ea2f40042c1c3a Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-11-19 15:22:50 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-12-01 02:46:07 +0000 arm: Implement atomic_testandset_acq_long as a simple wrapper Use a memory barrier after calling the existing atomic_testandset_long rather than using the fcmpset-based fallback version from <sys/_atomic_subword.h>. Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D47628 (cherry picked from commit 987c5a1944183cf82884fdb96b0432bd810aa8b9) --- sys/arm/include/atomic.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index 2cf97017b04a..dd2ad47e9bed 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -960,6 +960,17 @@ atomic_testandset_long(volatile u_long *p, u_int v) } #define atomic_testandset_long atomic_testandset_long +static __inline int +atomic_testandset_acq_long(volatile u_long *p, u_int v) +{ + int ret; + + ret = atomic_testandset_32((volatile uint32_t *)p, v); + dmb(); + return (ret); +} +#define atomic_testandset_acq_long atomic_testandset_acq_long + static __inline int atomic_testandset_64(volatile uint64_t *p, u_int v) { @@ -1097,7 +1108,6 @@ atomic_thread_fence_seq_cst(void) * For: * - atomic_load_acq_8 * - atomic_load_acq_16 - * - atomic_testandset_acq_long */ #include <sys/_atomic_subword.h>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412010457.4B14vN1C095811>