public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Mike Frysinger" <vapier.adi@gmail.com>
To: "Bryan Wu" <cooloney@kernel.org>
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: Thu, 20 Nov 2008 08:50:50 -0500	[thread overview]
Message-ID: <8bd0f97a0811200550o6bde2024k76f9cf2dd7aed384@mail.gmail.com> (raw)
In-Reply-To: <386072610811182342i701497bcne37e6ab0dbefbc5f@mail.gmail.com>

On Wed, Nov 19, 2008 at 02:42, Bryan Wu wrote:
> On Wed, Nov 19, 2008 at 2:56 PM, Andrew Morton wrote:
>> On Tue, 18 Nov 2008 17:05:05 +0800 Bryan Wu wrote:
>>> From: Graf Yang <graf.yang@analog.com>
>>> +#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.
>>
>
> As Nick said, include/asm-generic/bitops/non-atomic.h is the generic code.
> We will try it.

the Blackfin ISA provides explicit bit operations.  is there something
special about these C-level bit operations that prevents us from using
them ?

PRM:
"BITCLR" on page 13-2
"BITSET" on page 13-4
"BITTGL" on page 13-6
-mike

  reply	other threads:[~2008-11-20 13:51 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
2008-11-19  7:42     ` Bryan Wu
2008-11-20 13:50       ` Mike Frysinger [this message]
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=8bd0f97a0811200550o6bde2024k76f9cf2dd7aed384@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cooloney@kernel.org \
    --cc=graf.yang@analog.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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