mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bryan Wu" <cooloney@kernel.org>
To: "Nick Piggin" <nickpiggin@yahoo.com.au>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	torvalds@linux-foundation.org, mingo@elte.hu,
	linux-kernel@vger.kernel.org, "Graf Yang" <graf.yang@analog.com>
Subject: Re: [PATCH 2/5] Blackfin arch: SMP supporting patchset: Blackfin header files and machine common code
Date: Wed, 19 Nov 2008 15:44:47 +0800	[thread overview]
Message-ID: <386072610811182344p50f5d644qe6d415fe0bc5a017@mail.gmail.com> (raw)
In-Reply-To: <200811191805.07656.nickpiggin@yahoo.com.au>

On Wed, Nov 19, 2008 at 3:05 PM, Nick Piggin <nickpiggin@yahoo.com.au> wrote:
> On Wednesday 19 November 2008 17:56, Andrew Morton wrote:
>> On Tue, 18 Nov 2008 17:05:05 +0800 Bryan Wu <cooloney@kernel.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.

Yeah, I posted it to linux-arch.
Thanks
-Bryan

  reply	other threads:[~2008-11-19  7:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-18  9:05 [PATCH 0/5] Blackfin SMP like patchset Bryan Wu
2008-11-18  9:05 ` [PATCH 1/5] Blackfin arch: SMP supporting patchset: BF561 related code Bryan Wu
2008-11-19  6:56   ` Andrew Morton
2008-11-19  7:39     ` Bryan Wu
2008-11-19  8:10       ` gyang
2008-11-18  9:05 ` [PATCH 2/5] Blackfin arch: SMP supporting patchset: Blackfin header files and machine common code Bryan Wu
2008-11-19  6:56   ` Andrew Morton
2008-11-19  7:05     ` Nick Piggin
2008-11-19  7:44       ` Bryan Wu [this message]
2008-11-19  7:42     ` Bryan Wu
2008-11-20 13:50       ` Mike Frysinger
2008-11-19  7:52     ` gyang
2008-11-19  8:20       ` Bryan Wu
2008-11-19  7:44   ` Bryan Wu
2008-11-18  9:05 ` [PATCH 3/5] Blackfin arch: SMP supporting patchset: Blackfin CPLB related code Bryan Wu
2008-11-19  7:45   ` Bryan Wu
2008-11-18  9:05 ` [PATCH 4/5] Blackfin arch: SMP supporting patchset: Blackfin kernel and memory management code Bryan Wu
2008-11-19  7:46   ` Bryan Wu
2008-11-18  9:05 ` [PATCH 5/5] Blackfin arch: SMP supporting patchset: some other misc code Bryan Wu
2008-11-19  7:47   ` Bryan Wu
2008-11-19  6:56 ` [PATCH 0/5] Blackfin SMP like patchset Andrew Morton
2008-11-19  7:27   ` Bryan Wu
2008-11-19  7:28     ` Bryan Wu
2008-11-19 13:51   ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=386072610811182344p50f5d644qe6d415fe0bc5a017@mail.gmail.com \
    --to=cooloney@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=graf.yang@analog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®