Date: Wed, 12 Dec 2018 10:04:35 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341847 - stable/12/sys/compat/linuxkpi/common/include/asm Message-ID: <201812121004.wBCA4ZgO002537@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812121004.wBCA4ZgO002537>