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]
Message-Id: <200811191805.07656.nickpiggin@yahoo.com.au>
Date:	Wed, 19 Nov 2008 18:05:07 +1100
From:	Nick Piggin <nickpiggin@...oo.com.au>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Bryan Wu <cooloney@...nel.org>, torvalds@...ux-foundation.org,
	mingo@...e.hu, linux-kernel@...r.kernel.org,
	Graf Yang <graf.yang@...log.com>
Subject: Re: [PATCH 2/5] Blackfin arch: SMP supporting patchset: Blackfin header files and machine common code

On Wednesday 19 November 2008 17:56, Andrew Morton wrote:
> On Tue, 18 Nov 2008 17:05:05 +0800 Bryan Wu <cooloney@...nel.org> wrote:

> > +#define smp_mb__before_clear_bit()	barrier()
> > +#define smp_mb__after_clear_bit()	barrier()
> > +
> > +static inline void __set_bit(int nr, volatile unsigned long *addr)
> > +{
> > +	int *a = (int *)addr;
> > +	int mask;
> > +
> > +	a += nr >> 5;
> > +	mask = 1 << (nr & 0x1f);
> > +	*a |= mask;
> > +}
> > +
> > +static inline void __clear_bit(int nr, volatile unsigned long *addr)
> > +{
> > +	int *a = (int *)addr;
> > +	int mask;
> > +
> > +	a += nr >> 5;
> > +	mask = 1 << (nr & 0x1f);
> > +	*a &= ~mask;
> > +}
> > +
> > +static inline void __change_bit(int nr, volatile unsigned long *addr)
> > +{
> > +	int mask;
> > +	unsigned long *ADDR = (unsigned long *)addr;
> > +
> > +	ADDR += nr >> 5;
> > +	mask = 1 << (nr & 31);
> > +	*ADDR ^= mask;
> > +}
>
> I'm surprised there isn't any generic code which can be used for the above.

include/asm-generic/bitops/non-atomic.h


> > ...
>
> Gad what a lot of code.  I don't think I have time to read it all, sorry.

:) I don't know who is expected to. Cc'ing linux-arch for something
like this might attract some helpful comments.
--
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