svn commit: r341848 - stable/11/sys/compat/linuxkpi/common/include/asm
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Dec 12 10:05:42 UTC 2018
Author: hselasky
Date: Wed Dec 12 10:05:41 2018
New Revision: 341848
URL: https://svnweb.freebsd.org/changeset/base/341848
Log:
MFC r341591:
Fix build of the atomic long LinuxKPI header file on some platforms.
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Wed Dec 12 10:04:34 2018 (r341847)
+++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Wed Dec 12 10:05:41 2018 (r341848)
@@ -78,7 +78,15 @@ atomic_long_dec(atomic_long_t *v)
static inline long
atomic_long_xchg(atomic_long_t *v, long val)
{
+#if defined(__i386__) || defined(__amd64__) || defined(__aarch64__)
return atomic_swap_long(&v->counter, val);
+#else
+ long ret = atomic_long_read(v);
+
+ while (!atomic_fcmpset_long(&v->counter, &ret, val))
+ ;
+ return (ret);
+#endif
}
static inline long
More information about the svn-src-all
mailing list