Thread (12 messages) 12 messages, 5 authors, 2015-01-08

Re: [PATCH 1/3] powerpc: Don't use local named register variable in current_thread_info

From: Scott Wood <hidden>
Date: 2015-01-07 17:59:35

Possibly related (same subject, not in this thread)

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help