[PATCH 1/3] powerpc: Don't use local named register variable in current_thread_info
Scott Wood
scottwood at freescale.com
Thu Jan 8 04:59:21 AEDT 2015
On Wed, 2015-01-07 at 16:12 +1100, Anton Blanchard wrote:
> Thanks for looking into this. Does that mean we were just getting lucky
> with the previous version:
>
> static inline struct thread_info *current_thread_info(void)
> {
> register unsigned long sp asm("r1");
>
> return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
> }
>
> ie a static register asm instead of a global one. If so the safest fix
> for now might be to just eat the overead of a register move:
>
> static inline struct thread_info *current_thread_info(void)
> {
> unsigned long sp;
>
> asm("mr %0,1": "=r"(sp));
> return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
You could avoid the register move by doing a rlwinm/rldicr in inline
asm, if it matters enough.
-Scott
More information about the Linuxppc-dev
mailing list