svn commit: r341847 - stable/12/sys/compat/linuxkpi/common/include/asm

Hans Petter Selasky hselasky at FreeBSD.org
Wed Dec 12 10:04:36 UTC 2018


Author: hselasky
Date: Wed Dec 12 10:04:34 2018
New Revision: 341847
URL: https://svnweb.freebsd.org/changeset/base/341847

Log:
  MFC r341591:
  Fix build of the atomic long LinuxKPI header file on some platforms.
  
  Sponsored by:		Mellanox Technologies

Modified:
  stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h	Wed Dec 12 10:01:40 2018	(r341846)
+++ stable/12/sys/compat/linuxkpi/common/include/asm/atomic-long.h	Wed Dec 12 10:04:34 2018	(r341847)
@@ -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