aboutsummaryrefslogtreecommitdiff
path: root/lib/libthr
diff options
context:
space:
mode:
authorLeandro Lupori <luporl@FreeBSD.org>2019-02-13 18:28:53 +0000
committerLeandro Lupori <luporl@FreeBSD.org>2019-02-13 18:28:53 +0000
commit9031358d6797dc94dc81dab74f11e084aae9a377 (patch)
tree5b17773d120d6a46a427bdb83334be9b32cae059 /lib/libthr
parent35c91b0c278e38eaaa7fb3bfe0d18ead2e65b4b6 (diff)
Notes
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/arch/powerpc/include/pthread_md.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h
index a9923d7337d87..939d7d2670e97 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("addi %0,13,%1" : "=r"(tcb) : "i"(-TP_OFFSET));
#else
- __asm __volatile("mr %0,2" : "=r"(_tp));
+ __asm __volatile("addi %0,2,%1" : "=r"(tcb) : "i"(-TP_OFFSET));
#endif
- return ((struct tcb *)(_tp - TP_OFFSET));
+ return (tcb);
}
static __inline struct pthread *