This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC v2][PATCH 16/27] Add Infinity THREAD_SELF macros to sysdeps/tile/nptl/tls.h
- From: Gary Benson <gbenson at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 13 Jun 2016 11:38:20 +0100
- Subject: [RFC v2][PATCH 16/27] Add Infinity THREAD_SELF macros to sysdeps/tile/nptl/tls.h
- Authentication-results: sourceware.org; auth=none
- References: <1465814311-31470-1-git-send-email-gbenson at redhat dot com>
This commit adds Infinity THREAD_SELF macros for tile.
---
sysdeps/tile/nptl/tls.h | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
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. */
--
1.7.1