[U-Boot] [PATCH V4 1/4] ARM: Define change_bit routine
Amit Virdi
amit.virdi at st.com
Tue May 22 12:14:42 CEST 2012
>>
>> extern void clear_bit(int nr, volatile void * addr);
>>
>> -extern void change_bit(int nr, volatile void * addr);
>> -
>> static inline void __change_bit(int nr, volatile void *addr)
>> {
>> unsigned long mask = BIT_MASK(nr);
>> @@ -39,6 +37,11 @@ static inline void __change_bit(int nr, volatile void *addr)
>> *p ^= mask;
>> }
>>
>> +static inline void change_bit(int nr, volatile void *addr)
>> +{
>> + __change_bit(nr, addr);
>> +}
>> +
>> static inline int __test_and_set_bit(int nr, volatile void *addr)
>> {
>> unsigned long mask = BIT_MASK(nr);
>
> While they're not used much, U-Boot does have interrupt support (at
> least on powerpc -- not sure about ARM), so this should be atomic
> against interrupts.
>
> The NAND driver should be using __change_bit() instead.
>
Alright, I shall be soon sending V5 that drops this patch and uses
__change_bit directly.
Thanks
Amit Virdi
More information about the U-Boot
mailing list