diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2018-12-05 15:53:34 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2018-12-05 15:53:34 +0000 |
commit | 6da0d28e6a517df29003b593448c40209cac03a8 (patch) | |
tree | f4d62f86085ff58ea14aa28451f5a811634d54ab | |
parent | 8a886978d4931fa2d98befa8872c2267d152dd00 (diff) | |
download | src-6da0d28e6a517df29003b593448c40209cac03a8.tar.gz src-6da0d28e6a517df29003b593448c40209cac03a8.zip |
Fix some build of LinuxKPI on some platforms after r341518.
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=341591
-rw-r--r-- | sys/compat/linuxkpi/common/include/asm/atomic-long.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/asm/atomic-long.h b/sys/compat/linuxkpi/common/include/asm/atomic-long.h index d7f839f2541f..ee24c9a8f333 100644 --- a/sys/compat/linuxkpi/common/include/asm/atomic-long.h +++ b/sys/compat/linuxkpi/common/include/asm/atomic-long.h @@ -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 |