Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Dec 2018 15:53:34 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r341591 - head/sys/compat/linuxkpi/common/include/asm
Message-ID:  <201812051553.wB5FrYid052595@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Dec  5 15:53:34 2018
New Revision: 341591
URL: https://svnweb.freebsd.org/changeset/base/341591

Log:
  Fix some build of LinuxKPI on some platforms after r341518.
  
  MFC after:		1 week
  Sponsored by:		Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/asm/atomic-long.h

Modified: head/sys/compat/linuxkpi/common/include/asm/atomic-long.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/asm/atomic-long.h	Wed Dec  5 15:42:31 2018	(r341590)
+++ head/sys/compat/linuxkpi/common/include/asm/atomic-long.h	Wed Dec  5 15:53:34 2018	(r341591)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812051553.wB5FrYid052595>