Date: Tue, 4 Aug 2020 15:25:23 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <202008041525.074FPNLh043749@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: manu Date: Tue Aug 4 15:25:22 2020 New Revision: 363842 URL: https://svnweb.freebsd.org/changeset/base/363842 Log: 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 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 4 15:00:02 2020 (r363841) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:25:22 2020 (r363842) @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsigned #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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008041525.074FPNLh043749>