lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 15 Oct 2010 13:12:30 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Akinobu Mita <akinobu.mita@...il.com>
Cc:	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	Christoph Hellwig <hch@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	linux390@...ibm.com, linux-s390@...r.kernel.org
Subject: Re: [PATCH 03/22] s390: introduce little endian bitops

On Friday 15 October 2010, Akinobu Mita wrote:
> +#define __set_le_bit(nr, addr) \
> +       __set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define __clear_le_bit(nr, addr)       \
> +       __clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define __test_and_set_le_bit(nr, addr)        \
> +       __test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define test_and_set_le_bit(lock, nr, addr)    \
> +       test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define __test_and_clear_le_bit(nr, addr)      \
> +       __test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define test_and_clear_le_bit(lock, nr, addr)  \
> +       test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
> +#define test_le_bit(nr, addr)  \
> +       test_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))

The test_and_clear_le_bit and test_and_set_le_bit calling conventions
are a little surprising here. I would not pass the lock argument
here but leave that to the ext2 wrapper:

#define test_and_set_le_bit(nr, addr)    \
       test_and_set_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))
#define test_and_clear_le_bit(nr, addr)  \
       test_and_clear_bit((nr)^(__BITOPS_WORDSIZE - 8), (addr))

#define ext2_set_bit_atomic(lock, nr, addr)       \
       test_and_set_le_bit((nr), (unsigned long *)(addr))
#define ext2_clear_bit_atomic(lock, nr, addr)     \
       test_and_clear_le_bit((nr), (unsigned long *)(addr))

Same thing on arm and m68k.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ