svn commit: r364110 - head/sys/compat/linuxkpi/common/include/linux

Emmanuel Vadot manu at bidouilliste.com
Tue Aug 11 12:46:29 UTC 2020


On Tue, 11 Aug 2020 12:41:40 +0000 (UTC)
Hans Petter Selasky <hselasky at FreeBSD.org> wrote:

> 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

 Thanks Hans, I was doing a last build but you beat me to it.
 And thanks to Alan for suggesting using atomic_clear_rel_long directly.

 Note that clear_bit_unlock isn't used by any code at the moment so it
wasn't a big deal.

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


-- 
Emmanuel Vadot <manu at bidouilliste.com> <manu at freebsd.org>


More information about the svn-src-all mailing list