svn commit: r364110 - head/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Tue Aug 11 12:41:41 UTC 2020
Author: hselasky
Date: Tue Aug 11 12:41:40 2020
New Revision: 364110
URL: https://svnweb.freebsd.org/changeset/base/364110
Log:
Use atomic_clear_rel_long() to implement clear_bit_unlock() in the LinuxKPI
after r363842.
Suggested by: alc@
MFC after: 1 week
Sponsored by: Mellanox Technologies
Modified:
head/sys/compat/linuxkpi/common/include/linux/bitops.h
Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 11 12:17:46 2020 (r364109)
+++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 11 12:41:40 2020 (r364110)
@@ -272,15 +272,11 @@ find_next_zero_bit(const unsigned long *addr, unsigned
#define clear_bit(i, a) \
atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i))
+#define clear_bit_unlock(i, a) \
+ atomic_clear_rel_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i))
+
#define test_bit(i, a) \
!!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i))
-
-static inline void
-clear_bit_unlock(long bit, volatile unsigned long *var)
-{
- clear_bit(bit, var);
- wmb();
-}
static inline int
test_and_clear_bit(long bit, volatile unsigned long *var)
More information about the svn-src-all
mailing list