diff options
author | Emmanuel Vadot <manu@FreeBSD.org> | 2020-08-04 15:25:22 +0000 |
---|---|---|
committer | Emmanuel Vadot <manu@FreeBSD.org> | 2020-08-04 15:25:22 +0000 |
commit | 334680ab074cae5c7fa78ebcb04a9765bbf4fcea (patch) | |
tree | ae655914118f543567cf94540623a694b8fd73e3 /sys/compat/linuxkpi/common/include/linux | |
parent | cfae6a92ac013c3fd069ba802840b823f87e9457 (diff) | |
download | src-334680ab074cae5c7fa78ebcb04a9765bbf4fcea.tar.gz src-334680ab074cae5c7fa78ebcb04a9765bbf4fcea.zip |
linuxkpi: Add clear_bit_unlock
This calls clear_bit and adds a memory barrier.
Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25943
Notes
Notes:
svn path=/head/; revision=363842
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/bitops.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index f3c62596bcf5..7e259760f7c3 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsigned long size, #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) { |