Question: locomo_{read/write}l macros
H Hartley Sweeten
hartleys at visionengravers.com
Thu Jan 21 11:52:47 EST 2010
On Thursday, January 21, 2010 2:22 AM, Sergei Shtylyov wrote:
> Hello.
>
> H Hartley Sweeten wrote:
>
>> Hello all,
>>
>> Is there a reason why the locomo stuff is using custom
>> macros for {read/write}l access?
>>
>> In arch/arm/include/asm/hardware/locomo.h:
>>
>> #define locomo_writel(val,addr) ({ *(volatile u16 *)(addr) = (val); })
>> #define locomo_readl(addr) (*(volatile u16 *)(addr))
>>
>> It appears that these are just non-typesafe versions of the
>> __raw_{read/write}w macros in arch/arm/include/asm/io.h:
>>
>
> You mean __raw_{read/write}l for sure?
No.
The locomo_* macros are both using u16 *. The equivalent __raw_*
macros would be the unsigned short * type which is __raw_{read/write}w.
Plus, all the masking used with locomo_{read/write}l uses 16-bit
values. My guess is the names used for the locomo_* macros are
wrong.
Regards,
Hartley
More information about the linux-arm-kernel
mailing list