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
This commit is contained in:
Emmanuel Vadot 2020-08-04 15:25:22 +00:00
parent cfae6a92ac
commit 334680ab07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363842

View File

@ -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)
{