[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8bd0f97a0811200550o6bde2024k76f9cf2dd7aed384@mail.gmail.com>
Date: Thu, 20 Nov 2008 08:50:50 -0500
From: "Mike Frysinger" <vapier.adi@...il.com>
To: "Bryan Wu" <cooloney@...nel.org>
Cc: "Andrew Morton" <akpm@...ux-foundation.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 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@...log.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
--
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