diff mbox

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

Message ID 1465814311-31470-17-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 tile.
---
 sysdeps/tile/nptl/tls.h |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/sysdeps/tile/nptl/tls.h b/sysdeps/tile/nptl/tls.h
index c908fb8..c98761b 100644
--- a/sysdeps/tile/nptl/tls.h
+++ b/sysdeps/tile/nptl/tls.h
@@ -122,13 +122,18 @@  register void *__thread_pointer asm ("tp");
     ((struct pthread *) (__thread_pointer \
 			 - 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 REG_TP * 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.  */
 #ifdef __tilegx__
 # define DB_THREAD_SELF \
-  REGISTER (64, 64, REG_TP * 8, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+  REGISTER (64, 64, REG_TP * 8, I8_TS_REG_BIAS)
 #else
 # define DB_THREAD_SELF \
-  REGISTER (32, 32, REG_TP * 4, - TLS_TCB_OFFSET - TLS_PRE_TCB_SIZE)
+  REGISTER (32, 32, REG_TP * 4, I8_TS_REG_BIAS)
 #endif
 
 /* Read member of the thread descriptor directly.  */