mirror of
https://github.com/opnsense/src.git
synced 2026-04-29 10:11:09 -04:00
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:
parent
cfae6a92ac
commit
334680ab07
1 changed files with 7 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue