diff mbox

[RFC,v2,12/27] Add Infinity THREAD_SELF macros to sysdeps/powerpc/nptl/tls.h

Message ID 1465814311-31470-13-git-send-email-gbenson@redhat.com
State New
Headers show

Commit Message

Gary Benson June 13, 2016, 10:38 a.m. UTC
This commit adds Infinity THREAD_SELF macros for powerpc.
---
 sysdeps/powerpc/nptl/tls.h |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/sysdeps/powerpc/nptl/tls.h b/sysdeps/powerpc/nptl/tls.h
index 0e889bc..67b8a55 100644
--- a/sysdeps/powerpc/nptl/tls.h
+++ b/sysdeps/powerpc/nptl/tls.h
@@ -177,12 +177,15 @@  register void *__thread_register __asm__ ("r13");
     ((struct pthread *) (__thread_register \
 			 - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE))
 
+/* Magic for Infinity to know how to do THREAD_SELF.  */
+# define I8_THREAD_SELF I8_TS_REGISTER
+# define I8_TS_REG_OFFSET PT_THREAD_POINTER * sizeof (void *)
+# define I8_TS_REG_BIAS -(TLS_TCB_OFFSET + TLS_PRE_TCB_SIZE)
+
 /* Magic for libthread_db to know how to do THREAD_SELF.  */
 # define DB_THREAD_SELF							      \
-  REGISTER (32, 32, PT_THREAD_POINTER * 4,				      \
-	    - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)			      \
-  REGISTER (64, 64, PT_THREAD_POINTER * 8,				      \
-	    - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+  REGISTER (32, 32, PT_THREAD_POINTER * 4, I8_TS_REG_BIAS)		      \
+  REGISTER (64, 64, PT_THREAD_POINTER * 8, I8_TS_REG_BIAS)
 
 /* Read member of the thread descriptor directly.  */
 # define THREAD_GETMEM(descr, member) ((void)(descr), (THREAD_SELF)->member)