This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC v2][PATCH 12/27] Add Infinity THREAD_SELF macros to sysdeps/powerpc/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:16 +0100
- Subject: [RFC v2][PATCH 12/27] Add Infinity THREAD_SELF macros to sysdeps/powerpc/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 powerpc.
---
sysdeps/powerpc/nptl/tls.h | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
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)
--
1.7.1