diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h index a9923d7337d..6aea5605f8a 100644 --- a/lib/libthr/arch/powerpc/include/pthread_md.h +++ b/lib/libthr/arch/powerpc/include/pthread_md.h @@ -72,14 +72,15 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - register uint8_t *_tp; + register struct tcb *tcb; + #ifdef __powerpc64__ - __asm __volatile("mr %0,13" : "=r"(_tp)); + __asm __volatile("mr %0,13\n\t" "addi %0,-" TP_OFFSET : "=r"(tcb)); #else - __asm __volatile("mr %0,2" : "=r"(_tp)); + __asm __volatile("mr %0,2\n\t" "addi %0,-" TP_OFFSET : "=r"(tcb)); #endif - return ((struct tcb *)(_tp - TP_OFFSET)); + return tcb; } static __inline struct pthread *